/*
 * T3X2R Stage 1 shared product card.
 *
 * Base card styles are context-free so the same component can later own
 * Shop, Home, related, upsells and category cards. Grid layout and legacy
 * WooCommerce card neutralization are scoped to the Shop page for the
 * current prototype.
 */

/* ---------------------------------------------------------------------------
 * Card base
 * ------------------------------------------------------------------------ */

li.t3x2r-product-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: var(--t3x2r-text, #f5f5f5);
  font-family: Raleway, sans-serif;
  text-align: left;
  position: relative;
}

li.t3x2r-product-card::before,
li.t3x2r-product-card::after {
  display: none;
}

/* ============================================================
 * Full-card glass material
 * Only the decorative background is filtered; product media and text stay sharp.
 * ============================================================ */

.t3x2r-product-card {
  position: relative;
  min-height: 580px; /* full card height: media (aspect-ratio 1/1) + body */
}

/* A single optical surface spans the entire card, including unused grid height. */
body.woocommerce-shop li.product.t3x2r-product-card {
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px;
}

body.woocommerce-shop li.product.t3x2r-product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  background: rgba(16, 16, 16, 0);
  -webkit-backdrop-filter: blur(4px) saturate(125%);
  backdrop-filter: blur(4px) saturate(125%);
  z-index: 0;
  pointer-events: none;
}

@supports (backdrop-filter: url("#lens")) and (not (-webkit-backdrop-filter: blur(1px))) {
  body.woocommerce-shop li.product.t3x2r-product-card::before {
    backdrop-filter: var(--t3x2r-glass-filter, blur(2.2px)) saturate(125%);
  }
}

/* Directional rim highlights suggest thickness without tinting media or text. */
body.woocommerce-shop li.product.t3x2r-product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  border: 1px solid;
  border-color: rgba(255, 255, 255, 0.48) rgba(255, 255, 255, 0.16) rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.32);
  border-radius: inherit;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(255, 255, 255, 0.08);
  z-index: 3;
  pointer-events: none;
}

@media (forced-colors: active) {
  body.woocommerce-shop li.product.t3x2r-product-card::before {
    background: #171717;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
  }
}

/* Media remains outside the lens layer. */
.t3x2r-product-card__media {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: transparent;
  border-radius: 8px 8px 0 0;
}

.t3x2r-product-card__media-link {
  display: block;
  width: 100%;
  height: 100%;
}

.t3x2r-product-card__media-link:focus-visible {
  outline: 2px solid #50a5f6;
  outline-offset: -2px;
}

.t3x2r-product-card__media .tp-image-wrapper,
.t3x2r-product-card__media img {
  display: block;
  width: 100%;
  height: 100%;
}

.t3x2r-product-card__media img {
  object-fit: cover;
  transition: opacity 240ms ease-out;
}

.t3x2r-product-card__media .tp-image-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.t3x2r-product-card:hover .tp-image-hover,
.t3x2r-product-card__media-link:focus-visible .tp-image-hover {
  opacity: 1;
}

/* Wins over the Additional CSS `.woocommerce span.onsale` (blue pill)
   and `.woocommerce ul.products li.product .onsale` (top-right corner). */
li.product.t3x2r-product-card .t3x2r-product-card__media span.onsale {
  position: absolute;
  top: 12px;
  left: auto;
  right: 12px;
  bottom: auto;
  z-index: 2;
  display: inline-block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid;
  border-radius: 8px;
  background:#0a0a0a;
  color: #50a5f6;
  font-family: Raleway, sans-serif;
  font-size: 50px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: none;
}

.t3x2r-product-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  background: transparent;
  padding-bottom: 16px;
}

/* Content remains sharp above the full-card refracted background. */
.t3x2r-product-card__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px 16px;
  min-width: 0;
  height: auto;
  justify-content: flex-start;
}

li.product.t3x2r-product-card h3.t3x2r-product-card__title.t3x2r-product-card__title {
  margin: 0;
  color: #50a5f6;
  font-family: Raleway, sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* The linked name must use the card accent, not Inspiro's teal link color. */
li.product.t3x2r-product-card h3.t3x2r-product-card__title > a,
li.product.t3x2r-product-card h3.t3x2r-product-card__title > a:hover,
li.product.t3x2r-product-card h3.t3x2r-product-card__title > a:focus-visible {
  color: #50a5f6;
}
  font-family: Raleway, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

.t3x2r-product-card__price {
  color: #f5f5f5;
  font-family: Raleway, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.t3x2r-product-card__price .woocommerce-Price-amount {
  color: inherit;
}

.t3x2r-product-card__price del {
  color: #a8a8a8;
  font-size: 0.9em;
  font-weight: 400;
}

.t3x2r-product-card .t3x2r-product-card__price ins {
  color: #50a5f6;
  font-size: 22px;
  text-decoration: none;
}

.t3x2r-product-card__price .woocommerce-Price-currencySymbol {
  color: inherit;
}

.t3x2r-product-card__actions {
  margin-top: 8px;
}

/* The CTA carries .t3x2r-cta (added via woocommerce_loop_add_to_cart_args).
   Its static material matches the Home hero CTA without copying the
   pointer-light effect: the card already owns the interactive glass layer. */
.t3x2r-product-card__actions .t3x2r-cta {
  --t3x2r-cta-radius: 18px;
  --t3x2r-cta-tint: #101010;
  --t3x2r-cta-tint-opacity: 0.8;
  --t3x2r-cta-text: #f5f5f5;
  display: inline-flex;
  vertical-align: top;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 16px 28px !important;
  border: 1px solid !important;
  border-radius: var(--t3x2r-cta-radius) !important;
  background: color-mix(in srgb, var(--t3x2r-cta-tint) calc(var(--t3x2r-cta-tint-opacity) * 100%), transparent) !important;
  box-shadow: inset 0 0 0 1px #525252, 0 10px 24px -14px rgba(0, 0, 0, 0.45);
  color: var(--t3x2r-cta-text) !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  line-height: 1 !important;
  text-decoration: none;
  text-transform: none !important;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease-out;
}

.t3x2r-product-card__actions .t3x2r-cta:hover,
.t3x2r-product-card__actions .t3x2r-cta:focus-visible {
  background: #50a5f6  !important;
  box-shadow: inset 0 0 0 1px #747474, 0 12px 28px -14px rgba(0, 0, 0, 0.55);
  color: var(--t3x2r-cta-text) !important;
}

.t3x2r-product-card__actions .t3x2r-cta:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--t3x2r-cta-text) 55%, transparent);
  outline-offset: 3px;
}

.t3x2r-product-card__actions .t3x2r-cta:active,
.t3x2r-product-card__actions .added_to_cart:active {
  transform: scale(0.97);
}

.t3x2r-product-card__actions .button.loading {
  opacity: 0.6;
}

.t3x2r-product-card__actions .t3x2r-cta.disabled,
.t3x2r-product-card__actions .t3x2r-cta:disabled {
  box-shadow: inset 0 0 0 1px #3b3b3b;
  cursor: not-allowed;
  opacity: 0.5;
}

.t3x2r-product-card__actions .added_to_cart {
  display: inline-flex !important;
  vertical-align: top;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  box-sizing: border-box;
  margin: 0 0 0 5px !important;
  padding: 0px 15px !important;
  border: 1px solid #50a5f6;
  border-radius: 16px;
  background: #171717;
  color: #50a5f6;
  font-family: Raleway, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  transition: transform 160ms ease-out, color 180ms ease-out, border-color 180ms ease-out, background-color 180ms ease-out;
}

.t3x2r-product-card__actions .added_to_cart:hover,
.t3x2r-product-card__actions .added_to_cart:focus-visible {
  background: #50a5f6;
  color: #101010;
}

/* ---------------------------------------------------------------------------
 * Shop page background (DEVICES page)
 * ------------------------------------------------------------------------ */

body.woocommerce-shop {
  position: relative;
  isolation: isolate;
  background: #0a0a0a;
}

body.woocommerce-shop::before {
  content: none;
  display: none;
  background: none;
}

/* ---------------------------------------------------------------------------
 * Shop prototype grid (scoped to the Shop page only)
 * ------------------------------------------------------------------------ */

body.woocommerce-shop ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 24px;
  padding: 0;
  margin: 0 0 50px;
  list-style: none;
}

body.woocommerce-shop ul.products::before,
body.woocommerce-shop ul.products::after {
  display: none;
}

/* Neutralize legacy WooCommerce/theme card chrome within the prototype grid. */
body.woocommerce-shop ul.products li.product.t3x2r-product-card {
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: rgba(16, 16, 16, 0);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  text-align: left;
  overflow: hidden;
}

body.woocommerce-shop ul.products li.product.t3x2r-product-card:hover {
  transform: none;
}

/* Shop-specific glassmorphism card overrides */
body.woocommerce-shop ul.products li.product.t3x2r-product-card {
  min-height: 420px;
}

body.woocommerce-shop ul.products li.product.t3x2r-product-card .t3x2r-product-card__body {
  flex: 1;
  padding: 10px 16px 16px;
}

/* Fade out the lines beneath purchase information, retaining the full-card lens
   and the transparent media above. Only this decorative layer is darkened. */
body.woocommerce-shop .t3x2r-product-card__body::before {
  content: '';
  position: absolute;
  inset: -32px 0 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 12, 0) 0,
    rgba(8, 10, 12, 0.05) 32px,
    rgba(8, 10, 12, 0.05) 76px,
    rgba(8, 10, 12, 0.05) 100%
  );
  pointer-events: none;
}

body.woocommerce-shop li.product.t3x2r-product-card h3.t3x2r-product-card__title.t3x2r-product-card__title,
body.woocommerce-shop li.product.t3x2r-product-card h3.t3x2r-product-card__title > a {
  color: #f5f5f5;
}

body.woocommerce-shop li.product.t3x2r-product-card h3.t3x2r-product-card__title > a:hover,
body.woocommerce-shop li.product.t3x2r-product-card h3.t3x2r-product-card__title > a:focus-visible {
  color: #80bdf7;
}

body.woocommerce-shop .t3x2r-product-card__excerpt {
  margin: 0;
  color: #dfe4e9;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.woocommerce-shop .t3x2r-product-card__price {
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

/* Hide the "No products found" wrapper on the Shop page — the catalogue is
 * built via [products] shortcodes; the main loop returns empty. */
body.woocommerce-shop .woocommerce-no-products-found {
  display: none;
}

@media (max-width: 1023px) {
  body.woocommerce-shop ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 16px;
  }
}

@media (max-width: 640px) {
  body.woocommerce-shop ul.products {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .t3x2r-product-card__actions .t3x2r-cta,
  .t3x2r-product-card__actions .added_to_cart {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t3x2r-product-card__media img,
  .t3x2r-product-card__actions .t3x2r-cta,
  .t3x2r-product-card__actions .added_to_cart {
    transition-duration: 0.01ms;
  }
}

/* ---------------------------------------------------------------------------
 * Related / upsells on the single product page — same card format
 * ------------------------------------------------------------------------ */

body.woocommerce-page.single-product .related.products ul.products,
body.woocommerce-page.single-product .up-sells ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

body.woocommerce-page.single-product .related.products ul.products::before,
body.woocommerce-page.single-product .related.products ul.products::after,
body.woocommerce-page.single-product .up-sells ul.products::before,
body.woocommerce-page.single-product .up-sells ul.products::after {
  display: none;
}

body.woocommerce-page.single-product .related.products ul.products li.product,
body.woocommerce-page.single-product .up-sells ul.products li.product {
  width: auto;
  float: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(245, 245, 245, 0.12);
  border-radius: 8px;
  background-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.15);
  text-align: left;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  min-height: 420px;
  overflow: hidden;
}

body.woocommerce-page.single-product .related.products ul.products li.product.t3x2r-product-card,
body.woocommerce-page.single-product .up-sells ul.products li.product.t3x2r-product-card {
  background-image: var(--card-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.woocommerce-page.single-product .related.products ul.products li.product.t3x2r-product-card:hover,
body.woocommerce-page.single-product .up-sells ul.products li.product.t3x2r-product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(80, 165, 246, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(80, 165, 246, 0.3);
}

body.woocommerce-page.single-product .related.products ul.products li.product.t3x2r-product-card:hover .t3x2r-product-card__glass,
body.woocommerce-page.single-product .up-sells ul.products li.product.t3x2r-product-card:hover .t3x2r-product-card__glass {
  background: rgba(20, 10, 10, 0.40);
}

@media (max-width: 1023px) {
  body.woocommerce-page.single-product .related.products ul.products,
  body.woocommerce-page.single-product .up-sells ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 16px;
  }
}

@media (max-width: 640px) {
  body.woocommerce-page.single-product .related.products ul.products,
  body.woocommerce-page.single-product .up-sells ul.products {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
}
