/* ============================================================
   PlantMapper — Amazon affiliate "Recommended Products"
   Premium card component. Loaded last so it supersedes the older
   .affiliate rules. Products are curated from the master workbook;
   every link carries the plantmapperuk-21 Associates tag.
   ============================================================ */
.affiliate {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  background: linear-gradient(180deg, #fbfaf4, var(--bg-cream, #f7f3e8));
  padding: clamp(18px, 2.4vw, 26px);
}
.affiliate-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.affiliate-head .aff-title {
  display: inline-flex; align-items: center; gap: 9px; margin: 0;
  font-family: var(--font-serif); font-size: 1.12rem; color: var(--ink, #1d2a20);
}
.affiliate-head h4 {                 /* legacy heading elements keep working */
  display: inline-flex; align-items: center; gap: 9px; margin: 0;
  font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; color: var(--ink, #1d2a20);
}
.affiliate-head h4::before, .affiliate-head .aff-title::before {
  content: ""; flex: none; width: 20px; height: 20px;
  background: #235e34;
  -webkit-mask: var(--aff-bag) center/contain no-repeat;
          mask: var(--aff-bag) center/contain no-repeat;
}
.aff-tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #235e34; background: #e7f0dd; border: 1px solid #cfe2c2;
  padding: .22rem .6rem; border-radius: 999px; white-space: nowrap;
}
.product-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
}
.product-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line, #e6e2d4);
  border-radius: 14px; padding: 14px; text-decoration: none;
  color: var(--ink, #1d2a20);
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20,40,29,.14);
  border-color: #cfe2c2;
}
.product-thumb {
  height: 72px; border-radius: 10px; margin-bottom: 11px;
  display: grid; place-items: center;
  background: #eef3e8; color: #2f6b3f;
}
.product-thumb svg { width: 30px; height: 30px; }
/* category tints */
.pt-compost  { background: #efe7dc; color: #7a5a34; }
.pt-fert     { background: #e3efe6; color: #2f6b46; }
.pt-tools    { background: #e8ecef; color: #45606f; }
.pt-prop     { background: #e7f2e2; color: #3f7a41; }
.pt-water    { background: #e3eef5; color: #2f6a93; }
.pt-grow     { background: #f6e7e0; color: #b0533a; }
.pt-pest     { background: #ece7f2; color: #6b4f8f; }
.pt-lawn     { background: #e6f0dd; color: #4a7a2f; }
.pt-indoor   { background: #e2efe7; color: #2f7a55; }
.pt-fruit    { background: #efe4ee; color: #834a7a; }

.prating { font-size: .82rem; letter-spacing: .06em; color: #e0a428; line-height: 1; margin-bottom: 6px; }
.product-card .pbrand { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6a7a6c; margin-bottom: 2px; }
.product-card .pname { font-size: .95rem; font-weight: 650; line-height: 1.24; color: var(--ink, #17281d); }
.product-card .pmeta { font-size: .8rem; color: var(--muted, #5f6f63); margin-top: 4px; line-height: 1.4; flex: 1; }
.product-card .pcta {
  margin-top: 11px; display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; font-weight: 700; color: #235e34;
}
.product-card:hover .pcta { gap: 9px; }

.aff-disclosure {
  margin: 14px 0 0; font-size: .76rem; line-height: 1.5;
  color: var(--muted, #5f6f63);
}
.aff-disclosure svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; opacity: .7; }

/* shopping-bag mask used by the heading icon */
:root {
  --aff-bag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
}
/* standalone silo section wrapper (landing pages with no content sub-pages) */
.aff-section { max-width: 1000px; margin: 0 auto; padding: 8px 20px 54px; }

@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}
