/**
 * APS Card Styles — plugin product loops only.
 * ALL rules scoped to li.aps-has-card-style so the home widget is never affected.
 */

/* ── Base card ─────────────────────────────────────────────────────────────── */
li.aps-has-card-style > .aps-row-card {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: var(--cs-layout-background, #fff);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
li.aps-has-card-style > .aps-row-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Link wrapper */
li.aps-has-card-style .aps-row-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Thumbnail */
li.aps-has-card-style .aps-row-card__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
li.aps-has-card-style .aps-row-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Body */
li.aps-has-card-style .aps-row-card__body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Title — centered, larger, 2-line clamp */
li.aps-has-card-style .aps-row-card__title {
  font-size: var(--aps-title-size, 0.95rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--cs-headings-color, #111);
  margin: 0 0 6px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price (below title for default/compact) */
li.aps-has-card-style .aps-row-card__price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cs-light-accent-color, #258f44);
  margin-bottom: 6px;
  text-align: center;
}

/* Features — hidden in plugin loop */
li.aps-has-card-style .aps-row-card__features {
  display: none !important;
}

/* ── Price badge (showcase variants) ──────────────────────────────────────── */
li.aps-has-card-style .aps-row-card__price-badge {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cs-light-accent-color, #258f44);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  line-height: 1.4;
  box-shadow: 0 2px 12px rgba(0,0,0,0.28);
  white-space: normal !important;
  text-align: center;
  width: max-content;
  max-width: 85%;
  pointer-events: none;
}

/* Showcase Center: badge in middle of image */
li.aps-has-card-style .aps-row-card--showcase_center .aps-row-card__price-badge {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Compact: tighter padding */
li.aps-has-card-style .aps-row-card--compact .aps-row-card__body {
  padding: 6px 8px 8px;
  gap: 2px;
}

/* ── li sizing ─────────────────────────────────────────────────────────────── */
li.aps-has-card-style {
  box-sizing: border-box;
}

/* Hide the original .aps-product-box when card style is active */
li.aps-has-card-style > .aps-product-box {
  display: none;
}

/* Mobile: force 2 cards per row */
@media (max-width: 480px) {
  li.aps-has-card-style {
    width: 50% !important;
  }
}

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
[data-scheme="dark"] li.aps-has-card-style > .aps-row-card,
.cs-dark li.aps-has-card-style > .aps-row-card {
  border-color: rgba(255,255,255,0.08);
}
[data-scheme="dark"] li.aps-has-card-style .aps-row-card__title,
.cs-dark li.aps-has-card-style .aps-row-card__title {
  color: var(--cs-headings-color, #eee);
}
[data-scheme="dark"] li.aps-has-card-style .aps-row-card__thumb,
.cs-dark li.aps-has-card-style .aps-row-card__thumb {
  background: rgba(255,255,255,0.05);
}
