/* ─── DS KONGEN — Product Cards ─── */

.products.products-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px;
}
ul.products { list-style: none; padding: 0; }

/* Kill WooCommerce's default 18px padding on the LI so the image/button can
   sit flush with the card edge. WC's own stylesheet uses these exact
   selectors and ships its own !important on some of them — bumping
   specificity here with body-prefix + !important so we definitely win
   regardless of stylesheet load order. */
ul.products li.product,
.products.products-grid li.product,
.products.products-grid li.product-card,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
body ul.products li.product,
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product,
.dskr-shop-section ul.products li.product,
.dskr-shop-section ul.products li.product-card {
  padding: 0 !important;
  margin: 0 0 20px 0 !important;  /* keep vertical gap on rows without grid gap fallback */
  width: 100% !important;          /* fill the grid cell completely */
  max-width: 100% !important;
  float: none !important;          /* WC default floats the LI — kill it */
  list-style: none !important;
}

.product-card {
  background: var(--navy-card2); border: 1px solid rgba(255,215,0,0.1);
  position: relative; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  overflow: hidden; border-radius: 14px; list-style: none;
  cursor: pointer;
  /* Vertical flex column so the image area can grow to fill any extra height
     when grid rows stretch (e.g. one card has a 3-line title and forces the
     row taller). Without this, shorter cards leave a "hole" between the
     image and the text section. */
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card::before, .product-card::after {
  content: ''; position: absolute; width: 12px; height: 12px;
  border-color: var(--gold); border-style: solid; opacity: 0; transition: opacity 0.25s; z-index: 3;
}
.product-card::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.product-card::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.product-card:hover {
  border-color: rgba(255,215,0,0.4); transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 20px rgba(255,215,0,0.08);
}
.product-card:hover::before, .product-card:hover::after { opacity: 1; }

.product-card-link {
  display: block; text-decoration: none; color: inherit; position: relative;
  /* Grow to fill any extra card height when grid rows stretch. The image
     container inside fills 100% of this link's height, so a taller-than-
     square card grows the image vertically instead of leaving a gap. */
  flex: 1 1 auto;
  min-height: 0;
}

.product-img {
  width: 100%;
  /* Default to a 1:1 square (matches WC's 600x600 thumbnail size). If the
     parent .product-card-link is stretched taller by a sibling card in the
     same grid row, height: 100% takes over and the image fills that extra
     space. Background is dark navy so any letterboxing reads as intentional. */
  aspect-ratio: 1 / 1;
  height: 100%;
  background: #0a1220;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-sizing: border-box;
  /* Round the top corners of the image to match the card's 14px radius.
     The card already has overflow: hidden + border-radius: 14px, which
     should clip the image — but some browsers (and edge cases with
     position:relative + transform) miss this. Setting border-radius
     directly on the image container is explicit and reliable. */
  border-radius: 14px 14px 0 0;
}
.product-img img {
  width: 100%; height: 100%;
  /* contain (not cover) — show the full cover art without cropping the top
     or bottom. Game covers come in various aspect ratios (square retail
     photos, vertical disc cases, horizontal cartridge boxes); contain handles
     all of them. */
  object-fit: contain;
  display: block;
}

.product-img-placeholder {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(45deg, rgba(14,124,107,0.05) 0, rgba(14,124,107,0.05) 1px, transparent 1px, transparent 20px),
    linear-gradient(180deg, #0b1828 0%, #0d1f35 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-dim); font-family: var(--pixel); font-size: 8px; text-align: center; padding: 16px;
}
.product-img-placeholder .game-icon { font-size: 40px; filter: grayscale(0.3); }
.product-img-placeholder .placeholder-meta { color: rgba(255,255,255,0.3); }

.product-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: var(--pixel); font-size: 8px; padding: 6px 12px; border-radius: 8px;
}
.badge-sale { background: var(--red); color: #fff; box-shadow: 0 0 12px rgba(214,40,40,0.5); }
.badge-new  { background: var(--teal); color: #fff; box-shadow: 0 0 12px rgba(14,124,107,0.5); }
.badge-hot  { background: #ff6b00; color: #fff; box-shadow: 0 0 12px rgba(255,107,0,0.5); }

/* Text section under the image — give the title/price/condition real
   breathing room without indenting the button (which stays edge-to-edge).
   - Top: 14px between image bottom and title
   - Bottom: 0 — the button hugs the card's bottom edge so its 14px rounded
     bottom corners line up with the card's bottom-left/bottom-right corners,
     mirroring how the image's 14px rounded top corners line up with the
     card's top corners. Symmetric curves top & bottom.
   - Sides: 0 on the container so the button can be full-width
   The text elements get a 12px horizontal inset of their own. */
.product-info {
  padding: 14px 0 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}
.product-info .product-name,
.product-info .product-condition,
.product-info .product-pricing {
  padding-left: 12px;
  padding-right: 12px;
  text-align: center;
}
/* .product-pricing is a flex row (price + crossed-out price + save %) —
   text-align: center doesn't affect flex children; need justify-content. */
.product-info .product-pricing {
  justify-content: center;
}
/* Slightly larger vertical gap between title, condition, and price for
   readable rhythm now that the section has room. */
.product-info .product-name { margin-bottom: 8px; }
.product-info .product-condition { margin-bottom: 10px; }
.product-info .product-pricing { margin-bottom: 14px; }
.product-platform {
  font-family: var(--pixel); font-size: 8px; color: var(--teal-light);
  letter-spacing: 1px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
  text-shadow: 0 0 10px rgba(20,169,143,0.4);
}
.platform-dot { width: 5px; height: 5px; background: var(--teal-light); display: inline-block; }

.product-name {
  font-family: var(--body); font-weight: 800; font-size: 20px;
  color: var(--text); line-height: 1.2; margin: 0 0 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
  /* Wrap long titles correctly. overflow-wrap: anywhere lets the browser
     break inside a word as a last resort, preventing the right edge of
     "GAMES" or similar from being clipped by the card's overflow: hidden.
     hyphens: auto adds a soft-hyphen for graceful breaking when supported. */
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.product-name a { color: inherit; text-decoration: none; }
.product-condition { font-family: var(--prose); font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }

.product-pricing { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.price-now {
  font-family: var(--pixel); font-size: 17px; color: var(--gold);
  text-shadow: 0 0 14px rgba(255,215,0,0.5), 1px 1px 0 #4a3600;
}
.price-was { font-family: var(--body); font-size: 15px; color: var(--text-dim); text-decoration: line-through; }
.price-save {
  font-family: var(--pixel); font-size: 8px; color: var(--red-bright);
  background: rgba(214,40,40,0.12); padding: 3px 7px; border: 1px solid rgba(214,40,40,0.3);
}

.btn-add-cart, .product-card .button {
  /* Button now stretches edge-to-edge of the card (matches image width).
     Border-radius set to 0 because the card itself has a 14px radius and
     the bottom of the button now meets the bottom of the card. */
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, #c9a800 100%);
  color: var(--navy) !important; font-family: var(--pixel) !important; font-size: 9px !important;
  border: none; cursor: pointer; padding: 13px 16px !important;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
  border-radius: 0 0 14px 14px;
  text-decoration: none; text-transform: uppercase;
}
.btn-add-cart:hover, .product-card .button:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,215,0,0.4);
  background: linear-gradient(135deg, #ffe84d 0%, #d4af00 100%);
}
