/* ==========================================================================
   Gifts Gal & Affiliate Network - Master Card Components (cards.css)
   ========================================================================== */

/* ── Scaled Product Grid Container ── */
.products-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 28px;
  --card-scale: 0.75;
  transition: all 0.2s ease-out;
}

/* ── 1. Equalized Card Frame ── */
.affiliate-card,
.products-grid .affiliate-card {
  zoom: var(--card-scale, 0.75);
  position: relative;
  background-color: #ffffff;
  border: 1px solid #ede4d3;
  border-radius: 16px;
  padding: 24px;
  width: 340px;              /* Standardized column width */
  height: 620px;             /* Strict uniform card height */
  box-shadow: 0 2px 8px rgba(60, 42, 20, 0.05);
  color: #2b2118;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.affiliate-card:hover,
.products-grid .affiliate-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(60, 42, 20, 0.12);
  border-color: #d1b88e;
}

/* ── Badges ── */
.affiliate-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2e7d5b;
  background-color: #e8f4ed;
  border: 1px solid #cce3d4;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  align-self: flex-start;
  white-space: nowrap;
}

/* ── Equalized Titles (Clamped to 2 lines) ── */
.affiliate-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b2118;
  line-height: 1.35;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;             /* Reserves space for 2 lines */
}

/* ── Equalized Description & "... more" Trigger ── */
.affiliate-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #6e5f52;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;     /* Clamped to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.5em;             /* Fixed vertical block */
}

.card-more-link {
  color: #0284c7;
  text-decoration: underline;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-block;
}

/* ── Equalized Image Stage & Natural Sizing (Constrained) ── */
.variant-section,
.affiliate-card .variant-section {
  background-color: #f7f3ec;
  border: 1px solid #ebdcc5;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  height: 175px;
  min-height: 175px;
  max-height: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden !important;   /* Prevents overflow over bullet points */
  position: relative;
}

.variant-label,
.affiliate-card .variant-label {
  font-size: 0.78rem;
  color: #6e5f52;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.variant-label strong,
.affiliate-card .variant-label strong {
  color: #2b2118;
}

/* Strict Image Sizing — Cannot exceed stage */
.variant-section img,
.affiliate-card .variant-section img {
  max-height: 130px !important;
  max-width: 95% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 6px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: block;
  margin: auto;
}

/* ── Features List (Clamped to fit remaining card space) ── */
.affiliate-features {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  flex-grow: 1;
  overflow: hidden;
}

.affiliate-features li {
  font-size: 0.8rem;
  color: #4a3e35;
  padding: 4px 0;
  border-top: 1px solid #f1ece4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.affiliate-features li::before {
  content: "•";
  color: #b38226;
  font-size: 1rem;
  line-height: 0;
}

/* ── Action Footer ── */
.affiliate-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.affiliate-btn {
  display: block !important;
  text-align: center !important;
  background: linear-gradient(180deg, #fbb034 0%, #d97706 100%) !important;
  color: #1a1208 !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25) !important;
  transition: all 0.18s ease !important;
  cursor: pointer;
  position: relative;
}

.affiliate-btn:hover {
  background: linear-gradient(180deg, #fca511 0%, #b45309 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35) !important;
}

/* Stretched link overlay for 360° card click */
.affiliate-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.affiliate-disclosure {
  font-size: 0.68rem !important;
  color: #6e5f52 !important;
  text-align: center;
}