/* Newsmatic Products Feed Grid Widget */
:root{
  --nm-pfgw-gap: 18px;
  --nm-pfgw-radius: 10px;
  --nm-pfgw-border: rgba(0,0,0,.10);
  --nm-pfgw-tag-border: rgba(0,0,0,.12);
  --nm-pfgw-bg: transparent;
  --nm-pfgw-accent: #84BD00; /* Pantone 376-ish */
  --nm-pfgw-btn-text: #fff;
}

/* dark-mode compatibility (Newsmatic + common variants) */
body.newsmatic_dark_mode,
body.dark-mode,
body.dark,
body.night-mode{
  --nm-pfgw-border: rgba(255,255,255,.14);
  --nm-pfgw-tag-border: rgba(255,255,255,.18);
  --nm-pfgw-bg: rgba(255,255,255,.02);
}

.nm-pfgw-widget-desc{
  margin: -6px 0 12px;
  font-size: 13px;
  line-height: 1.4;
  opacity: .85;
}

.nm-pfgw-grid{ display:grid; gap:var(--nm-pfgw-gap); }
.nm-pfgw-cols-1{ grid-template-columns:repeat(1,minmax(0,1fr)); }
.nm-pfgw-cols-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }
.nm-pfgw-cols-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.nm-pfgw-cols-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.nm-pfgw-cols-5{ grid-template-columns:repeat(5,minmax(0,1fr)); }
.nm-pfgw-cols-6{ grid-template-columns:repeat(6,minmax(0,1fr)); }

@media (max-width:1024px){ .nm-pfgw-cols-5,.nm-pfgw-cols-6{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:840px){ .nm-pfgw-cols-4,.nm-pfgw-cols-5,.nm-pfgw-cols-6{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
/* Pe mobil vrem 1 coloană (nu 2). */
@media (max-width:768px){ .nm-pfgw-grid{ grid-template-columns:1fr !important; } }

.nm-pfgw-card{
  display:flex;
  flex-direction:column;
  border:1px solid var(--nm-pfgw-border);
  border-radius:var(--nm-pfgw-radius);
  overflow:hidden;
  background:var(--nm-pfgw-bg);
}

.nm-pfgw-thumb{
  display:block;
  line-height:0;
  text-decoration:none;
  position:relative;
  overflow:hidden;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  /* fallback pentru raport fix (4:3) fără pseudo-elemente (evită conflicte în zona comentariilor) */
  height:0;
  padding-top:75%;
}

/* imagine uniformă: același raport/înălțime pe toate cardurile */
@supports (aspect-ratio: 1 / 1) {
  .nm-pfgw-thumb{ aspect-ratio: 4 / 3; height:auto; padding-top:0; }
}

.nm-pfgw-thumb img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  z-index:1;
}

.nm-pfgw-thumb-placeholder{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.06);
}

.nm-pfgw-body{ padding:12px 12px 14px; }

.nm-pfgw-title{ margin:0 0 8px 0; font-size:14px; line-height:1.3; }
.nm-pfgw-title a{ color:inherit; text-decoration:none; }
.nm-pfgw-title a:hover{ text-decoration:underline; }

.nm-pfgw-price{ font-size:18px; font-weight:700; margin-bottom:8px; }
.nm-pfgw-producer{ font-size:12px; opacity:.9; margin-bottom:8px; }
.nm-pfgw-producer a{ text-decoration:none; }
.nm-pfgw-producer a:hover{ text-decoration:underline; }

.nm-pfgw-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.nm-pfgw-tag{
  display:inline-flex;
  padding:2px 8px;
  border:1px solid var(--nm-pfgw-tag-border);
  border-radius:999px;
  font-size:12px;
  line-height:1.2;
  text-decoration:none;
  color:inherit;
  opacity:.9;
}
.nm-pfgw-tag:hover{ opacity:1; text-decoration:none; }

.nm-pfgw-actions{ margin-top:6px; }
.nm-pfgw-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:8px;
  background:var(--nm-pfgw-accent);
  /* tema poate forța culoarea link-urilor; butonul trebuie să rămână alb */
  color:var(--nm-pfgw-btn-text) !important;
  text-decoration:none;
  font-weight:600;
  font-size:13px;
}
.nm-pfgw-btn:hover{ filter:brightness(.97); }

.nm-pfgw-empty{ padding:12px 0; opacity:.85; }
