/* ============================================================
   Product Card — shared by index.html, product-list.html and
   product-detail.html.

   Extracted from product-list.html's inline <style> so the same
   card renders identically everywhere. Class names are unchanged
   (`pl-` prefix) so existing markup and JS keep working.

   Paired with js/product-card.js, which builds the markup.
   ============================================================ */

.pl-card {
  background: #fff;
  border: 1px solid var(--csl-border, #e2e8f0);
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--csl-shadow-sm, 0 4px 14px rgba(15, 39, 71, 0.05));
}

.pl-card:hover {
  box-shadow: var(--csl-shadow-md, 0 10px 30px rgba(15, 39, 71, 0.08));
  transform: translateY(-3px);
  border-color: #bfdbfe;
}

/* A fixed 3:2 box, NOT height:auto.
   With auto height the box took each image's own aspect ratio, so a tall
   upload made its card taller than its neighbours (and, inside a Bootstrap
   row, stretched every card beside it). object-fit:cover had nothing to
   crop against. Pinning the ratio makes every card identical regardless of
   what an admin uploads; 3:2 matches the bundled 1536x1024 artwork, so the
   existing images are unchanged. */
.pl-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
}

.pl-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pl-card-shield {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  width: max-content;
  font-weight: 700;
  line-height: normal;
  padding: 5px;
  background: #ff976f;
  border-radius: 3px;
  display: flex;
  color: #fff;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.pl-card-shield i {
  font-size: 16px;
  color: #4f46e5;
}

.pl-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pl-card-state {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.pl-card-category {
  font-size: 13px;
  color: #64748b;
  margin: -6px 0 0;
}

/* ─── Tags ─── */
.pl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pl-tags.newproducts-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}

.pl-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.pl-tag-verified { background: #dcfce7; color: #15803d; }
.pl-tag-excel    { background: #dcfce7; color: #15803d; padding: 4px 8px; }
.pl-tag-pdf      { background: #fee2e2; color: #dc2626; padding: 4px 8px; }
.pl-tag-updated  { background: #dbeafe; color: #1d4ed8; }

/* ─── Feature list ─── */
.pl-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pl-features li {
  font-size: 12.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 7px;
}

.pl-features li i {
  color: #94a3b8;
  font-size: 13px;
  flex-shrink: 0;
}

/* ─── Price ─── */
.pl-card-footer {
  display: flex;
  align-items: center;
  justify-content: start;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
  gap: 6px;
}

.pl-price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pl-real-price {
  color: #999;
  font-size: 14px;
  text-decoration: line-through;
}

.pl-price {
  color: #111;
  font-size: 20px;
  font-weight: 700;
}

.pl-off {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e8f7ed;
  color: #198754;
  font-size: 12px;
  font-weight: 700;
}

/* ─── Actions ─── */
.pl-action-btns {
  display: flex;
  gap: 8px;
}

.pl-view-btn,
.pl-buy-btn,
.pl-buy-btn:focus,
.pl-buy-btn:active {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pl-view-btn {
  background: var(--csl-pastel-blue, #eef6ff);
  border: 1px solid #bfdbfe;
  color: var(--csl-primary, #2563eb);
  border-radius: 8px;
}

.pl-view-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: var(--csl-primary-dark, #1d4ed8);
}

.pl-buy-btn {
  background: var(--csl-primary, #2563eb);
  border: 1px solid var(--csl-primary, #2563eb);
  color: #fff;
  border-radius: 8px;
}

.pl-buy-btn:hover {
  background: var(--csl-primary-dark, #1d4ed8);
  border-color: var(--csl-primary-dark, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

@media (max-width: 575px) {
  .pl-action-btns {
    flex-direction: column;
  }
}

/* ─── Equal heights inside the homepage carousel ───
   Owl lays its stage out as block with floated items, so slides never stretch
   to a common height and `.pl-card { height: 100% }` has no container to
   resolve against. Making the stage a flex row lets the cards equalise the
   way they already do in the Bootstrap grid on product-list.html.
   Scoped to the products carousel so other Owl sliders are untouched. */
#home-products-row .owl-stage {
  display: flex;
}

#home-products-row .owl-item {
  display: flex;
  height: auto;
}

#home-products-row .owl-item > .pl-card {
  width: 100%;
}
