/*
 * LUBO.pl — Karta Produktu (współdzielona)
 * Ładowany wszędzie gdzie wyświetlane są produkty:
 *   - strona główna (polecane produkty)
 *   - archiwum / katalog (is_shop, is_product_category)
 *   - strona produktu (is_product) — powiązane produkty
 */

/* ==================== SIATKA PRODUKTÓW ==================== */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ==================== KARTA PRODUKTU ==================== */
.prod {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.prod:hover { border-color: var(--ink-3); box-shadow: var(--shadow); }

/* Zdjęcie / placeholder kółka */
.prod .img {
  aspect-ratio: 1;
  background: #fff;
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
}
.prod .img::before {
  content: "";
  position: absolute; inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4f5f8 0%, #d8dde6 55%, #b9c0cb 100%);
  border: 1.5px solid #2a3140;
  box-shadow:
    inset 0 0 0 6px #fff,
    inset 0 0 0 7px #c8ced9,
    0 8px 16px rgba(17,21,28,0.08);
}
.prod .img::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 12%; height: 12%;
  background: radial-gradient(circle at 35% 35%, #4a5366, #11151c 80%);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Warianty materiałów */
.prod .img.var-set::before { background: radial-gradient(circle at 35% 35%, #f4f5f8 0%, #c8ced9 55%, #9ea7b6 100%); }
.prod .img.var-rubber::before { background: radial-gradient(circle at 35% 35%, #4a5366 0%, #1a1f29 70%, #0a0d12 100%); border-color: #000; }
.prod .img.var-iron::before { background: radial-gradient(circle at 35% 35%, #8c95a6 0%, #4a5366 60%, #2a3140 100%); border-color: #11151c; }
.prod .img.var-nylon::before { background: radial-gradient(circle at 35% 35%, #fff 0%, #ede9dc 60%, #c9c2a8 100%); }
.prod .img.var-heavy::before { inset: 9%; }

/* Zdjęcie produktu (zamiast placeholdera) */
.prod .img.with-photo {
  background-color: #fff;
  background-size: 86%;
  background-position: center 55%;
  background-repeat: no-repeat;
}
.prod .img.with-photo::before,
.prod .img.with-photo::after { display: none; content: none; }

/* Odznaki */
.prod .badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}
.badge-orange { background: var(--orange); color: #fff; }
.badge-steel  { background: var(--steel);  color: #fff; }
.badge-green  { background: var(--green);  color: #fff; }
.badge-amber  { background: var(--amber);  color: #fff; }
.badge-soft   { background: var(--surface-3); color: var(--ink-2); }

/* Treść karty */
.prod .body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}
.prod .sku { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-4); letter-spacing: 0.04em; }
.prod .name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0; min-height: 2.6em; }
.prod .specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.prod .specs span { display: inline-flex; align-items: center; gap: 4px; }
.prod .specs span::before { content: ""; width: 3px; height: 3px; background: var(--ink-4); border-radius: 50%; display: inline-block; }
.prod .specs span:first-child::before { display: none; }

/* Cena */
.prod .price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}
.prod .price-row .price { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.prod .price-row .price .currency { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.prod .price-row .net { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-4); }
.prod .price-row .old { font-size: 12.5px; color: var(--ink-4); text-decoration: line-through; margin-right: 6px; }

/* Stan magazynowy */
.prod .stock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); font-weight: 500; }
.prod .stock::before { content: ""; width: 7px; height: 7px; background: var(--green); border-radius: 50%; display: inline-block; }
.prod .stock.low { color: var(--amber); }
.prod .stock.low::before { background: var(--amber); }

/* Akcje */
.prod .actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }

/* Przycisk dodaj do koszyka — stylizuje WooCommerce .button */
.prod .actions .button,
.prod .actions a.button {
  flex: 1;
  height: 40px;
  background: var(--ink) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: var(--r) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  transition: background 0.15s;
  text-decoration: none !important;
  cursor: pointer;
  padding: 0 16px !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.prod .actions .button:hover,
.prod .actions a.button:hover {
  background: var(--orange) !important;
  color: #fff !important;
}

/* Stan: ładowanie */
.prod .actions .button.loading {
  opacity: 0.65;
  pointer-events: none;
}

/* Stan: dodano — zielony przycisk */
.prod .actions .button.added,
.prod .actions a.button.added {
  background: var(--green) !important;
  color: #fff !important;
}

/* "Zobacz koszyk" link po dodaniu — ukryty w karcie (koszyk dostępny przez ikonę w headerze) */
.prod .actions .added_to_cart {
  display: none !important;
}

.prod .compare-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  border-radius: var(--r);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.prod .compare-btn:hover { color: var(--steel); border-color: var(--steel); }
.prod .compare-btn.active { color: var(--steel); border-color: var(--steel); background: var(--steel-soft); }
