/* =========================================================================
   Product Showcase Pro  -  all rules scoped under .opc-psp
   Cards are flex columns with gap; disabled elements simply are not rendered,
   so spacing collapses naturally. No reserved heights, no placeholders.
   ========================================================================= */
.opc-psp {
  --psp-gap: 18px;
  --psp-radius: 8px;
  --psp-ratio: 1 / 1;
  --psp-grid-cols: 4;
  --psp-img-pad: 8px;
  --psp-arrow: 44px;
  --psp-accent: #0090ff;
  --psp-btn: #0090ff;
  --psp-card-bg: #ffffff;
  --psp-ink: #1f2933;
  --psp-text: #334155;
  --psp-muted: #64748b;
  --psp-line: #e3e8ee;
  --psp-pad: 14px;
  --psp-cgap: 8px;
  width: 100%;
}

.opc-psp,
.opc-psp * {
  box-sizing: border-box;
}

.opc-psp--density-compact     { --psp-pad: 10px; --psp-cgap: 5px; }
.opc-psp--density-comfortable { --psp-pad: 14px; --psp-cgap: 8px; }
.opc-psp--density-spacious    { --psp-pad: 20px; --psp-cgap: 12px; }

/* ------------------------------------------------------------------ Header */
.opc-psp__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.opc-psp__header--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.opc-psp__header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.opc-psp__headline {
  margin: 0;
  color: var(--psp-ink);
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.opc-psp__subheadline {
  margin: 0;
  color: var(--psp-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.opc-psp__intro {
  margin-top: 6px;
  color: var(--psp-text);
  font-size: 14px;
  line-height: 1.6;
}

.opc-psp__intro > :last-child { margin-bottom: 0; }

.opc-psp__viewall {
  flex: 0 0 auto;
  align-self: center;
  padding: 9px 18px;
  border: 1px solid var(--psp-btn);
  border-radius: 6px;
  color: var(--psp-btn);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.opc-psp__viewall:hover,
.opc-psp__viewall:focus {
  background: var(--psp-btn);
  color: #fff;
  text-decoration: none;
}

/* ------------------------------------------------------------------ Slider */
.opc-psp__stage {
  position: relative;
  padding: 0 var(--psp-arrow);
}

.opc-psp__viewport {
  overflow: hidden;
  overscroll-behavior-inline: contain;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}

.opc-psp.is-dragging .opc-psp__viewport { cursor: grabbing; }

.opc-psp__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--psp-gap) * 4)) / 5);
  align-items: stretch;
  gap: var(--psp-gap);
  padding: 4px 2px 12px;
  transform: translate3d(0, 0, 0);
  transition: transform 0.44s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.opc-psp.is-dragging .opc-psp__track { transition: none; }

.opc-psp__grid {
  display: grid;
  grid-template-columns: repeat(var(--psp-grid-cols), minmax(0, 1fr));
  align-items: stretch;
  gap: var(--psp-gap);
}

/* -------------------------------------------------------------------- Card */
.opc-psp__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--psp-radius);
  background: var(--psp-card-bg);
  color: var(--psp-text);
  text-align: center;
  -webkit-user-drag: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.opc-psp--align-left .opc-psp__card { text-align: left; }

.opc-psp--style-bordered .opc-psp__card { border-color: var(--psp-line); }
.opc-psp--style-elevated .opc-psp__card { border-color: var(--psp-line); box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06); }

/* Quiet hover: border + shadow only, no movement. */
.opc-psp__card:hover,
.opc-psp__card:focus-within {
  border-color: color-mix(in srgb, var(--psp-accent) 42%, transparent);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.opc-psp--style-clean .opc-psp__card:hover,
.opc-psp--style-clean .opc-psp__card:focus-within {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* Separator style: no card box, just a thin divider between items. */
.opc-psp--style-separator .opc-psp__track,
.opc-psp--style-separator .opc-psp__grid {
  gap: 0;
}

.opc-psp--style-separator .opc-psp__card {
  position: relative;
  padding: 0 calc(var(--psp-gap) / 2);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.opc-psp--style-separator .opc-psp__card + .opc-psp__card::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 16px;
  left: 0;
  width: 1px;
  background: var(--psp-line);
}

.opc-psp--style-separator .opc-psp__card:hover,
.opc-psp--style-separator .opc-psp__card:focus-within {
  border-color: transparent;
  box-shadow: none;
}

/* ------------------------------------------------------------------- Media */
.opc-psp__media-link {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
}

.opc-psp__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: var(--psp-ratio);
  overflow: hidden;
  padding: var(--psp-img-pad);
  background: #fff;
}

.opc-psp--ratio-natural .opc-psp__media { aspect-ratio: auto; min-height: 180px; }

.opc-psp__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.opc-psp--fit-cover .opc-psp__image { object-fit: cover; }

/* ------------------------------------------------------------------ Badges */
.opc-psp__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-flow: row wrap;       /* side by side, one line at the top of each card */
  gap: 5px;
}

.opc-psp__badge {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
}

.opc-psp__badge--sale { background: #c9252d; }
.opc-psp__badge--new  { background: #16803c; }
.opc-psp__badge--top  { background: var(--psp-accent); }

/* -------------------------------------------------------------------- Body */
.opc-psp__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: var(--psp-cgap);
  padding: var(--psp-pad);
}

.opc-psp--align-left .opc-psp__body { align-items: flex-start; }

.opc-psp__brand {
  color: var(--psp-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.opc-psp__title {
  display: block;
  width: 100%;
  color: var(--psp-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s ease;
}

.opc-psp__title > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.opc-psp__card:hover .opc-psp__title,
.opc-psp__card:focus-within .opc-psp__title { color: var(--psp-accent); }

.opc-psp__meta {
  color: var(--psp-muted);
  font-size: 12px;
  line-height: 1.35;
}

.opc-psp__meta span { font-weight: 700; }

.opc-psp__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--psp-muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ------------------------------------------------------------------ Rating */
.opc-psp__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--psp-muted);
}

.opc-psp__stars {
  position: relative;
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  color: var(--psp-line);
}

.opc-psp__stars::before { content: "\2605\2605\2605\2605\2605"; letter-spacing: 1px; }

.opc-psp__stars-on {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f5a623;
}

.opc-psp__stars-on::before { content: "\2605\2605\2605\2605\2605"; letter-spacing: 1px; }

/* ---------------------------------------------------------------- Delivery */
.opc-psp__delivery { font-size: 12px; line-height: 1.35; color: var(--psp-muted); }
.opc-psp__delivery span { font-weight: 700; color: var(--psp-ink); }
.opc-psp__delivery--available { color: #16803c; }
.opc-psp__delivery--low { color: #b7791f; }
.opc-psp__delivery--unavailable { color: #c9252d; }

/* ------------------------------------------------------------------- Price */
.opc-psp__price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.opc-psp--align-left .opc-psp__price { align-items: flex-start; }

.opc-psp__price-current > * { margin: 0; }

.opc-psp__price .price,
.opc-psp__price .productbox-price {
  color: var(--psp-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.opc-psp__price .footnote-reference,
.opc-psp__price .price-note { color: var(--psp-muted); font-size: 11px; }

.opc-psp__price-old {
  display: flex;
  gap: 4px;
  color: #c9252d;
  font-size: 12px;
  line-height: 1.25;
}

.opc-psp__price-old span { font-weight: 700; }
.opc-psp__price-old del { text-decoration-color: currentColor; }

/* ----------------------------------------------------------------- Actions */
.opc-psp__actions {
  display: flex;
  align-items: center;
  gap: var(--psp-cgap);
  width: 100%;
  margin-top: auto;          /* pin to card bottom without reserved height */
  padding-top: calc(var(--psp-cgap) + 4px);
}

.opc-psp--actions-stacked .opc-psp__actions { flex-direction: column; align-items: stretch; }
.opc-psp--actions-row .opc-psp__actions { flex-direction: row; }
.opc-psp--align-left.opc-psp--actions-stacked .opc-psp__actions { align-items: flex-start; }

.opc-psp__cta {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--psp-btn) 34%, transparent);
  border-radius: 6px;
  background: #fff;
  color: var(--psp-btn);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.opc-psp--cta-fill .opc-psp__cta { border-color: var(--psp-btn); background: var(--psp-btn); color: #fff; }
.opc-psp--cta-dark .opc-psp__cta { border-color: var(--psp-ink); background: var(--psp-ink); color: #fff; }

.opc-psp__cta:hover,
.opc-psp__cta:focus { text-decoration: none; }

.opc-psp__cart-form { display: flex; margin: 0; }
.opc-psp--actions-stacked .opc-psp__cart-form { width: 100%; }

.opc-psp__cart {
  appearance: none;
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--psp-btn) 34%, transparent);
  border-radius: 6px;
  background: #fff;
  color: var(--psp-btn);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.opc-psp--cart-icon .opc-psp__cart,
.opc-psp__cart--icon { flex: 0 0 auto; width: 40px; min-height: 38px; padding: 0; }

.opc-psp--cart-icon .opc-psp__cart-text,
.opc-psp__cart--icon .opc-psp__cart-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.opc-psp--cart-fill .opc-psp__cart { border-color: var(--psp-btn); background: var(--psp-btn); color: #fff; }

/* =========================================================================
   Button hover effects (self-contained, theme-independent).
   Applied to CTA + cart via the .opc-psp--hover-* class on the wrapper.
   ========================================================================= */

/* "Faerben" + "Swoosh" both fill the button with the button colour on hover. */
.opc-psp--hover-fill .opc-psp__cta:hover,
.opc-psp--hover-fill .opc-psp__cta:focus,
.opc-psp--hover-fill .opc-psp__cart:hover,
.opc-psp--hover-fill .opc-psp__cart:focus,
.opc-psp--hover-swoosh .opc-psp__cta:hover,
.opc-psp--hover-swoosh .opc-psp__cta:focus,
.opc-psp--hover-swoosh .opc-psp__cart:hover,
.opc-psp--hover-swoosh .opc-psp__cart:focus {
  border-color: var(--psp-btn);
  background: var(--psp-btn);
  color: #fff;
}

/* "Anheben" keeps the base look but raises the button with a soft shadow. */
.opc-psp--hover-lift .opc-psp__cta:hover,
.opc-psp--hover-lift .opc-psp__cta:focus,
.opc-psp--hover-lift .opc-psp__cart:hover,
.opc-psp--hover-lift .opc-psp__cart:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--psp-btn) 30%, transparent);
}

/* "Swoosh": a light shine sweeps across the button. */
.opc-psp--hover-swoosh .opc-psp__cta,
.opc-psp--hover-swoosh .opc-psp__cart {
  position: relative;
  overflow: hidden;
}

.opc-psp--hover-swoosh .opc-psp__cta::before,
.opc-psp--hover-swoosh .opc-psp__cart::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 80%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.opc-psp--hover-swoosh .opc-psp__cta:hover::before,
.opc-psp--hover-swoosh .opc-psp__cart:hover::before {
  left: 130%;
}

@media (prefers-reduced-motion: reduce) {
  .opc-psp--hover-lift .opc-psp__cta:hover,
  .opc-psp--hover-lift .opc-psp__cart:hover { transform: none; }
  .opc-psp--hover-swoosh .opc-psp__cta::before,
  .opc-psp--hover-swoosh .opc-psp__cart::before { transition: none; }
}

/* ------------------------------------------------------------------- Arrows */
.opc-psp__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 60px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--psp-accent) 34%, transparent);
  border-radius: 6px;
  background: #fff;
  color: var(--psp-accent);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.opc-psp__nav--prev { left: 0; }
.opc-psp__nav--next { right: 0; }

.opc-psp__nav:hover,
.opc-psp__nav:focus { border-color: var(--psp-accent); background: var(--psp-accent); color: #fff; }

/* --------------------------------------------------------------------- Dots */
.opc-psp__dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.opc-psp__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--psp-line);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.opc-psp__dot.is-active { background: var(--psp-accent); transform: scale(1.25); }

/* -------------------------------------------------------------------- Empty */
.opc-psp__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 24px;
  border: 1px dashed var(--psp-line);
  border-radius: var(--psp-radius);
  color: var(--psp-muted);
  text-align: center;
}

/* ------------------------------------------------------------------ Preview */
.opc-psp-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 200px;
  padding: 26px;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: #fff;
  color: #1f2933;
}

.opc-psp-preview__stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 14px;
  width: min(520px, 100%);
}

.opc-psp-preview__stage span {
  aspect-ratio: 3 / 4;
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.opc-psp-preview__caption { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 991px) {
  .opc-psp__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .opc-psp { --psp-gap: 12px; --psp-arrow: 0px; }
  .opc-psp__stage { padding: 0; }
  .opc-psp__nav { width: 32px; height: 52px; font-size: 22px; }
  .opc-psp__nav--prev { left: 4px; }
  .opc-psp__nav--next { right: 4px; }
  .opc-psp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opc-psp__header { align-items: flex-start; }
  .opc-psp__title { font-size: 13px; }
}

@media (max-width: 420px) {
  .opc-psp__grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
