.lse-affiliate-products,
.lse-affiliate-single {
  --lse-aff-accent: var(--theme-palette-color-1, #b44830);
  --lse-aff-text: #171d1a;
  --lse-aff-muted: #626964;
  --lse-aff-surface: #ffffff;
  --lse-aff-border: rgba(30, 41, 59, .14);
  --lse-aff-heading: #171d1a;
  --lse-aff-disclosure: #626964;
  --lse-aff-radius: 14px;
  margin: 2rem 0;
}

.lse-affiliate-products--dark,
.lse-affiliate-single--dark {
  --lse-aff-text: #f7f7f3;
  --lse-aff-muted: rgba(247, 247, 243, .72);
  --lse-aff-surface: rgba(0, 0, 0, .16);
  --lse-aff-border: rgba(255, 255, 255, .12);
  --lse-aff-heading: #ffffff;
  --lse-aff-disclosure: rgba(255, 255, 255, .74);
}

/* Use inside a dark page section when the product cards themselves should stay light. */
.lse-affiliate-products--dark-section,
.lse-affiliate-single--dark-section {
  --lse-aff-text: #171d1a;
  --lse-aff-muted: #626964;
  --lse-aff-surface: #ffffff;
  --lse-aff-border: rgba(30, 41, 59, .14);
  --lse-aff-heading: #ffffff;
  --lse-aff-disclosure: rgba(255, 255, 255, .78);
}

.lse-affiliate-products--dark-section .lse-affiliate-products__heading,
.lse-affiliate-single--dark-section .lse-affiliate-products__heading {
  color: #ffffff !important;
}

.lse-affiliate-products--dark-section .lse-affiliate-disclosure,
.lse-affiliate-single--dark-section .lse-affiliate-disclosure {
  color: rgba(255, 255, 255, .78) !important;
}

.lse-affiliate-products--dark-section .lse-affiliate-disclosure strong,
.lse-affiliate-single--dark-section .lse-affiliate-disclosure strong {
  color: #ffffff !important;
}

.lse-affiliate-products__heading {
  margin: 0 0 .65rem;
  color: var(--lse-aff-heading);
}

.lse-affiliate-disclosure {
  margin: 0 0 1rem;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--lse-aff-disclosure);
}

.lse-affiliate-products__grid {
  display: grid;
  grid-template-columns: repeat(var(--lse-aff-cols, 4), minmax(0, 1fr));
  gap: 1rem;
}

.lse-affiliate-products[data-lse-columns="1"] { --lse-aff-cols: 1; }
.lse-affiliate-products[data-lse-columns="2"] { --lse-aff-cols: 2; }
.lse-affiliate-products[data-lse-columns="3"] { --lse-aff-cols: 3; }
.lse-affiliate-products[data-lse-columns="4"] { --lse-aff-cols: 4; }

.lse-affiliate-single .lse-affiliate-product {
  max-width: 720px;
}

.lse-affiliate-product {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--lse-aff-surface);
  border: 1px solid var(--lse-aff-border);
  border-radius: var(--lse-aff-radius);
  color: var(--lse-aff-text);
}

.lse-affiliate-product__image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(127,127,127,.06);
}

.lse-affiliate-product__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lse-affiliate-product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem;
}

.lse-affiliate-product__badge {
  align-self: flex-start;
  display: inline-flex;
  margin: 0 0 .65rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lse-aff-accent) 12%, transparent);
  color: var(--lse-aff-accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lse-affiliate-product__title {
  margin: 0 0 .55rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: inherit;
}

.lse-affiliate-product__description {
  margin: 0 0 1rem;
  color: var(--lse-aff-muted);
  font-size: .92rem;
  line-height: 1.6;
}

.lse-affiliate-product__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  min-height: 44px;
  padding: .72rem 1rem;
  border-radius: 9px;
  background: var(--lse-aff-accent);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.lse-affiliate-product__button:hover,
.lse-affiliate-product__button:focus {
  opacity: .9;
  color: #fff;
}

.lse-affiliate-product--invalid {
  padding: 1rem;
  border-style: dashed;
}

.lse-affiliate-global-disclosure {
  width: 100%;
  padding: .7rem 1rem;
  border-top: 1px solid rgba(127,127,127,.18);
  background: rgba(127,127,127,.05);
  color: inherit;
  font-size: .78rem;
  line-height: 1.45;
  text-align: center;
}

.lse-affiliate-global-disclosure__inner {
  width: min(100%, var(--gb-container-width, 1200px));
  margin-inline: auto;
}

@media (max-width: 900px) {
  .lse-affiliate-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .lse-affiliate-products__grid {
    grid-template-columns: 1fr;
  }
}
