/* Shared product / shop card grid */
.product-wrap {
  position: relative;
}
.product-grid,
.product-track,
.shop-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  align-items: stretch;
  overflow: visible;
}
.shop-grid,
.related-grid {
  gap: 22px;
}
.product-track::-webkit-scrollbar {
  display: none;
}

.product-card,
.shop-card {
  display: grid;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.04);
  /* cover | title | author | price | button — all auto except button height */
  grid-template-rows: auto auto auto auto 44px;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  height: 100%;
  min-width: 0;
  background: var(--color-white);
  border: 1px solid var(--color-cream);
  border-radius: var(--radius);
  padding: 12px;
  text-align: left;
  box-sizing: border-box;
  transition:
    background var(--transition),
    border-color var(--transition);
}
.product-card:hover,
.shop-card:hover {
  background: var(--color-cream);
  border-color: var(--color-beige);
}
.product-card.is-page-hidden,
.shop-card.is-page-hidden {
  display: none !important;
}
.product-link {
  color: var(--color-secondary);
}
.product-link:hover {
  color: var(--color-primary);
}

.product-card .cover,
.shop-card .cover,
.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  max-width: 100%;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-content: center;
  color: var(--color-white);
  margin: 0 0 12px;
  box-sizing: border-box;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-cream);
}
.cover span {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  padding: 14px;
}
.cover small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 14px 14px;
}
.cover-1 {
  background: linear-gradient(160deg, #3d3832, #6b6358);
}
.cover-2 {
  background: linear-gradient(160deg, #2a2622, #5c5348);
}
.cover-3 {
  background: linear-gradient(160deg, #3a342c, #8a7a62);
}
.cover-4 {
  background: linear-gradient(160deg, #2c2824, #6e5e4c);
}
.cover-5 {
  background: linear-gradient(160deg, #3a3228, #a89070);
}
.cover-6 {
  background: linear-gradient(160deg, #2e2a26, #6a6058);
}
.cover-7 {
  background: linear-gradient(160deg, #322e2a, #7a6e62);
}
.cover-8 {
  background: linear-gradient(160deg, #363028, #b8a078);
}

.product-card h3,
.shop-card h3 {
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  margin: 0 !important;
  padding: 0;
  text-transform: none;
  overflow: hidden;
  align-self: start;
  height: auto;
}
.product-card h3 a,
.shop-card h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: inherit;
}
.product-card .product-card-author,
.shop-card .product-card-author {
  margin: 4px 0 8px;
  font-size: 1rem;
  color: #8d99dd;
  /* font-family:'Courier New', Courier, monospace; */

  line-height: 1.3;
}
/* Cards with extra info (tag / author / review pages) — let rows flow naturally */
.shop-card.has-meta {
  grid-template-rows: auto;
  grid-auto-rows: auto;
}
.shop-card .card-rating {
  /* display: flex; */
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 8px;
  line-height: 1;
}
.shop-card .card-rating .stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1;
}
.shop-card .card-rating .star {
  --star-fill: 100%;
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  line-height: 1;
}
.shop-card .card-rating .star-bg,
.shop-card .card-rating .star-fg {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 1;
  font-size: 1em;
}
.shop-card .card-rating .star-bg {
  color: rgba(0, 0, 0, 0.14);
}
.shop-card .card-rating .star-fg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  width: var(--star-fill);
  color: var(--color-star);
}
.shop-card .card-rating-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
}
.shop-card .card-desc {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-muted);
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.shop-card.has-meta .card-desc {
  -webkit-line-clamp: 1;
  line-clamp: 2;
}

.shop-card__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
.product-card .price,
.shop-card .price,
.price {
  color: var(--color-red);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.2;
}
/* Sale price (ins) — independent style, no inheritance */
.product-card .price ins,
.shop-card .price ins,
.price ins {
  text-decoration: none;
  color: var(--color-red);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}
/* Old price (del) — independent style, no inheritance */
.product-card .price del,
.shop-card .price del,
.price del {
  color: var(--color-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  text-decoration: line-through;
  margin-right: 6px;
}
.product-card .add-btn,
.shop-card .add-btn,
.add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin: 0;
  background: var(--color-primary);
  color: var(--color-white);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 0 14px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  align-self: end;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.product-card .add-btn:hover,
.shop-card .add-btn:hover,
.add-btn:hover {
  background: var(--color-blue-soft);
  border-color: var(--color-blue-soft);
  color: var(--color-white);
}

/* Product cards: keep "Add to cart" on one line with a smaller font.
   !important beats the .add-btn.button rules in woocommerce-core.css. */
.product-card .add-btn,
.shop-card .add-btn {
  padding: 0 8px !important;
  font-size: 12px;
  letter-spacing: 0.5px !important;
  text-transform: none !important;
  white-space: nowrap;
}

/* Hide WC “View cart” link after AJAX add on product cards */
.product-card .added_to_cart,
.shop-card .added_to_cart,
.product-grid .added_to_cart,
.products .added_to_cart,
.shop-grid .added_to_cart {
  display: none !important;
}

/* Tag archive — reference card styling */
.tag-page .shop-card.has-meta {
  padding: 16px;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.06);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}
.tag-page .shop-card.has-meta:hover {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.08);
  transform: translateY(-2px);
}
.tag-page .shop-card .cover {
  border-radius: 10px;
  margin-bottom: 14px;
}
.tag-page .shop-card h3 {
  font-size: 1.2rem !important;
  line-height: 1.35 !important;
}
.tag-page .shop-card .product-card-author {
  margin: 2px 0 6px;
  font-size: 1rem;
  color: #8d99dd;
}
.tag-page .shop-card .card-rating {
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.tag-page .shop-card .price,
.tag-page .shop-card .price ins {
  color: #1c1917;
  font-size: 1.5rem;
}
.tag-page .shop-card .price del {
  color: #a8a29e;
  font-size: 1rem;
}
.tag-page .shop-card .add-btn {
  border-radius: 10px;
  background: #2563eb;
  border-color: #2563eb;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  font-weight: 600;
}
.tag-page .shop-card .add-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
