/* ==========================================================================
   FairTech Product Card Redesign
   Scoped entirely to .product-card-v1 (the one live card template, included
   on ~100 pages) plus its own new .ds-product-badge / .ds-stock-status
   elements. Loaded after style-min.css so it wins the cascade for the
   handful of properties (hover transform/shadow, .details-button) that
   file already sets. Cards now match the sitewide dark navy background
   (site-background.css) — dark glass with a blue glow, same family as the
   hero cards, instead of the earlier white "floating card" treatment.
   ========================================================================== */

.product-card-v1 {
  perspective: 1200px;
  padding: var(--ds-space-xs, 8px);
  box-sizing: border-box;
}

/* ---- Card surface: rounded corners, glass surface, subtle border, shadow ---- */

.product-card-v1 .product-card-v1-link {
  position: relative;
  background: linear-gradient(165deg, var(--ds-surface-2, #121b30) 0%, var(--ds-surface-1, #0d1526) 100%);
  border: 1px solid var(--ds-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--ds-shadow-sm, 0 2px 10px rgba(2, 6, 16, 0.35));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 320ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow 320ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              border-color 320ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              opacity var(--ds-duration-slow, 520ms) var(--ds-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

/* Short capped stagger for cards within a single product grid (spec: keep
   it short). Scoped to the shared .product-card-container-v1 wrapper that
   every category/listing page already renders — no per-page changes needed. */
.product-card-container-v1 > .product-card-v1:nth-child(1) .reveal-scale { transition-delay: 0ms; }
.product-card-container-v1 > .product-card-v1:nth-child(2) .reveal-scale { transition-delay: 40ms; }
.product-card-container-v1 > .product-card-v1:nth-child(3) .reveal-scale { transition-delay: 80ms; }
.product-card-container-v1 > .product-card-v1:nth-child(4) .reveal-scale { transition-delay: 120ms; }
.product-card-container-v1 > .product-card-v1:nth-child(5) .reveal-scale { transition-delay: 160ms; }
.product-card-container-v1 > .product-card-v1:nth-child(6) .reveal-scale { transition-delay: 200ms; }
.product-card-container-v1 > .product-card-v1:nth-child(n+7) .reveal-scale { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .product-card-container-v1 .reveal-scale {
    transition-delay: 0ms !important;
  }
}

.product-card-v1 .product-image {
  position: relative;
  background: var(--ds-surface-1, #0d1526);
}

.product-card-v1 .product-image::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -4px;
  height: 16px;
  border-radius: 50%;
  background: rgba(61, 139, 255, 0.35);
  filter: blur(12px);
  opacity: 0;
  transform: scaleX(0.85);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: none;
}

/* ---- 3D hover: lift + very slight rotate, image moves forward, shadow expands ---- */

@media (hover: hover) and (pointer: fine) {
  .product-card-v1 .product-card-v1-link:hover {
    transform: translateY(-8px) rotateX(2.5deg) rotateY(3deg);
    box-shadow: var(--ds-shadow-lg, 0 24px 60px rgba(2, 6, 16, 0.55)), 0 0 26px rgba(61, 139, 255, 0.35);
    border-color: var(--ds-border-accent, rgba(56, 132, 255, 0.4));
  }

  .product-card-v1 .product-card-v1-link:hover .product-image {
    transform: translateZ(28px);
  }

  .product-card-v1 .product-card-v1-link:hover .product-image::after {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* Touch devices: simple, brief lift on tap — no rotation/translateZ, no stuck hover */
@media not all and (hover: hover) {
  .product-card-v1 .product-card-v1-link:active {
    transform: translateY(-3px);
    box-shadow: var(--ds-shadow-md, 0 12px 32px rgba(2, 6, 16, 0.45));
  }
}

.product-card-v1 .product-card-v1-link:focus-visible {
  outline: 2px solid var(--ds-accent, #3d8bff);
  outline-offset: 3px;
  transform: translateY(-4px);
  box-shadow: var(--ds-shadow-md, 0 12px 32px rgba(2, 6, 16, 0.45));
}

/* ---- Text: card surface is now dark, so title/rating (previously
   plain black from style.css) need to flip to light ---- */

.product-card-v1 .product-name h3 {
  color: var(--ds-text-primary, #f3f6fc);
}

.product-card-v1 .rating-number {
  color: var(--ds-text-muted, #7c869c);
}

@media (prefers-reduced-motion: reduce) {
  .product-card-v1 .product-card-v1-link,
  .product-card-v1 .product-main-img,
  .product-card-v1 .product-image,
  .product-card-v1 .product-image::after {
    transition-duration: 1ms;
  }
  .product-card-v1 .product-card-v1-link:hover {
    transform: translateY(-4px);
  }
  .product-card-v1 .product-card-v1-link:hover .product-image {
    transform: none;
  }
}

/* ---- Badges: New/Best Seller kept out (no reliable backing data — see summary);
   Sale, Refurbished, Used are wired to real columns (dis_percentage, use_type) ---- */

.ds-product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  line-height: 1.4;
}

.ds-product-badge--pos-right {
  left: auto;
  right: 10px;
}

.ds-badge--refurb {
  background: linear-gradient(135deg, #3d8bff, #0066ff);
}

.ds-badge--used {
  background: linear-gradient(135deg, #64748b, #475569);
}

.ds-badge--sale {
  background: linear-gradient(135deg, #ff5470, #e11d48);
}

/* ---- Stock/status line — reads product_price_info.inven_status as-is ---- */

.product-card-v1 .ds-stock-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
}

.ds-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.ds-stock--in {
  color: #0ea968;
}
.ds-stock--in .ds-stock-dot {
  background: #0ea968;
}

.ds-stock--out {
  color: #e11d48;
}
.ds-stock--out .ds-stock-dot {
  background: #e11d48;
}

.ds-stock--neutral {
  color: var(--ds-text-muted, #7c869c);
}
.ds-stock--neutral .ds-stock-dot {
  background: var(--ds-text-muted, #7c869c);
}

/* ---- Price: make the live/sale price visually dominant (styling only,
   the £ values themselves are untouched — same $row fields as before) ---- */

.product-card-v1 .price .current-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--ds-text-primary, #f3f6fc);
}

.product-card-v1 .price .old-price {
  font-size: 15px;
  opacity: 0.6;
  color: var(--ds-text-muted, #7c869c);
}

.product-card-v1 .bottom-line {
  border-bottom-color: var(--ds-border-subtle, rgba(255, 255, 255, 0.08));
}

/* ---- Add to Cart: modernised pill, press feedback (still the same link
   click-through to the product page — no second cart system introduced) ---- */

.product-card-v1 .details-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.product-card-v1 .details-button .material-symbols-outlined {
  font-size: 17px;
}

.product-card-v1 .details-button:active {
  transform: scale(0.97);
}
