/* ==========================================================
   PEPTORIA — product cards (homepage, shop, and the related /
   upsell products on theme-drawn product pages).
   Scoped to .product-grid: WooCommerce uses .price, .add etc.
   on its own product pages.
   ========================================================== */
.product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;font-family:var(--font);line-height:1.6;color:var(--ink)}
/* Base for pages without home.css; :where() keeps it weaker than the rules below */
:where(.product-grid) :where(a){color:inherit;text-decoration:none}
:where(.product-grid) :where(img,svg){display:block;max-width:100%}
:where(.product-grid) :where(button){font:inherit;color:inherit;margin:0}
:where(.product-grid) :where(h3,p){margin:0}

.product-grid .card{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;transition:border-color .15s,box-shadow .2s}
.product-grid .card[hidden]{display:none}
.product-grid .card:hover{border-color:#B9CFC0;box-shadow:0 22px 44px -30px rgba(6,55,31,.5)}
.product-grid .card-media{position:relative;display:block;aspect-ratio:1/1.04;padding:18px 26px 6px;background:linear-gradient(180deg,#F6F5F1 0%,#ECEBE4 100%)}
.product-grid .card-media>svg,.product-grid .card-media>img{position:absolute;top:18px;left:26px;width:calc(100% - 52px);height:calc(100% - 24px);object-fit:contain}
/* Product photos sit on their own backdrop; the card takes the photo's edge colour so the letterboxing is invisible. */
.product-grid .card-media.has-photo{padding:0;background:var(--media-bg,#F4F0EC)}
.product-grid .card-media.has-photo>img{top:0;left:0;width:100%;height:100%;object-fit:contain;transition:transform .35s ease}
.product-grid .card:hover .card-media.has-photo>img{transform:scale(1.03)}
.product-grid .tag{position:absolute;top:12px;left:12px;z-index:1;font-size:12.5px;font-weight:600;line-height:1;padding:7px 11px;border-radius:99px;background:#fff;color:var(--green-900);border:1px solid var(--line)}
.product-grid .tag-gold{background:var(--gold-soft);border-color:transparent;color:#4F3E10}
.product-grid .card-body{display:flex;flex-direction:column;flex:1;gap:12px;padding:16px 18px 18px}
.product-grid .card-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.product-grid .card-cat{font-size:13px;color:var(--slate)}
.product-grid .card-coa{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;color:var(--green)}
.product-grid .card-coa svg{width:15px;height:15px}
.product-grid .card-coa:hover{color:var(--green-900);text-decoration:underline;text-underline-offset:3px}
.product-grid .card h3{font-size:18px;line-height:1.25;font-weight:700;letter-spacing:-.012em;text-transform:none;margin-top:-6px;color:var(--ink)}
.product-grid .card h3 a{color:inherit;text-decoration:none}
.product-grid .card h3 a:hover{color:var(--green)}
.product-grid .size-block{display:grid;gap:7px}
.product-grid .size-label{font-size:12.5px;font-weight:600;color:var(--slate)}
.product-grid .sizes{display:flex;flex-wrap:wrap;gap:6px}
.product-grid .size{height:31px;padding:0 10px;border-radius:7px;border:1px solid var(--line);background:#fff;font-size:13px;font-weight:500;cursor:pointer}
.product-grid .size:hover{border-color:var(--green)}
.product-grid .size[aria-checked="true"]{border-color:var(--green);background:var(--mist);color:var(--green-900);font-weight:600;box-shadow:inset 0 0 0 1px var(--green)}
.product-grid .size[aria-disabled="true"]{color:var(--slate);text-decoration:line-through;text-decoration-color:rgba(85,101,92,.55)}
.product-grid .card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:4px}
.product-grid .price{margin:0;font-size:20px;font-weight:700;letter-spacing:-.015em;line-height:1.1;color:var(--ink)}
.product-grid .price small{margin-right:4px;font-size:13px;font-weight:500;letter-spacing:0;color:var(--slate)}
.product-grid .add{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 15px;border:0;border-radius:9px;background:var(--green);color:#fff;font-size:14.5px;font-weight:600;cursor:pointer;white-space:nowrap;transition:background-color .15s,opacity .15s}
.product-grid .add svg{width:17px;height:17px}
.product-grid .add:hover{background:var(--green-700);color:#fff}
.product-grid .add.added{background:var(--green-900)}
.product-grid .add.is-loading{opacity:.75;cursor:progress}
.product-grid .add:disabled:not(.is-loading):not(.added){background:#A9B8AE;cursor:not-allowed}

@media (max-width:1120px){.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:820px){.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}}
@media (max-width:560px){
  /* Mobile: original 2-column vertical cards, tightened */
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .product-grid .card{position:relative;border-radius:12px}
  .product-grid .card-media{aspect-ratio:1/.88}
  .product-grid .card-media>svg,.product-grid .card-media>img{top:10px;left:10px;width:calc(100% - 20px);height:calc(100% - 14px)}
  .product-grid .tag{top:8px;left:8px;padding:5px 8px;font-size:11px}
  .product-grid .card-top{position:absolute;top:8px;right:8px;z-index:2}
  .product-grid .card-cat{display:none}
  .product-grid .card-coa{padding:5px 8px;border-radius:99px;background:#fff;border:1px solid var(--line);font-size:11px;line-height:1}
  .product-grid .card-coa svg{width:12px;height:12px}
  .product-grid .card-coa .coa-word{display:none}
  .product-grid .card-body{padding:10px 10px 12px;gap:8px}
  .product-grid .card h3{margin:0;font-size:15px;line-height:1.3;min-height:2.6em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .product-grid .size-label{display:none}
  .product-grid .size{height:28px;padding:0 6px;font-size:11.5px;border-radius:6px}
  .product-grid .sizes{gap:4px}
  .product-grid .card-foot{flex-direction:column;align-items:stretch;gap:8px;padding-top:2px}
  .product-grid .price{font-size:16.5px}
  .product-grid .price small{font-size:11.5px}
  .product-grid .add{height:40px;padding:0 10px;font-size:14px;justify-content:center;gap:6px}
  .product-grid .add svg{width:16px;height:16px}
}


/* Related products / upsells on product pages: room before the footer */
.related.products:has(> .product-grid),.upsells.products:has(> .product-grid){padding-bottom:72px}
@media (max-width:620px){.related.products:has(> .product-grid),.upsells.products:has(> .product-grid){padding-bottom:48px}}
