/* ============================================================
   5V Digital v2 — assets/css/product.css
   ============================================================ */

/* Article wrapper — NOT a grid, just block */
.fvd2-single-product {
  display: block !important;
}

/* 2-column product grid */
.fvd2-product-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 3rem !important;
  align-items: start !important;
  width: 100% !important;
  margin-bottom: 3rem;
}

/* Gallery column */
.fvd2-single-gallery {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e2e5ea);
}

.fvd2-single-gallery .woocommerce-product-gallery img {
  max-height: 480px;
  width: 100% !important;
  object-fit: contain !important;
  background: var(--color-bg, #f5f6f8);
}

/* "New Arrival" badge on single product page (functions.php
   fvd_new_product_badge) — was unstyled plain text. */
.fvd-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 3;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.fvd-badge--new {
  background: var(--color-primary-lt, #e0f2fe);
  color: var(--color-primary, #0369a1);
}

/* Summary column */
.fvd2-single-summary {
  padding-left: 0 !important;
}

/* Trust bar */
.fvd2-product-trust {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, #e2e5ea);
}

.fvd2-product-trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-mid, #6b7280);
}

.fvd2-product-trust-item svg {
  color: var(--color-teal, #4a9eb5);
}

/* Compatibility box */
.fvd2-compat-box {
  background: rgba(26,95,168,0.04);
  border: 1px solid rgba(26,95,168,0.15);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.fvd2-compat-box__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-charcoal, #1a1d1f);
  margin-bottom: 0.35rem;
}

.fvd2-compat-box p {
  font-size: 0.82rem;
  color: var(--color-mid, #6b7280);
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

/* WooCommerce product cards in archive */
ul.products li.product {
  border: 1px solid var(--color-border, #e2e5ea) !important;
  border-radius: 14px !important;
  overflow: hidden;
  transition: all 0.2s;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
}

ul.products li.product:hover {
  box-shadow: 0 4px 16px rgba(2,132,199,0.08);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
  .fvd2-product-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Single product page — constrain to container */
.single-product .fvd2-container {
  max-width: 1220px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

/* ============================================================
   PRODUCT CARDS — archive (content-product.php)
   ============================================================ */

.fvd2-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-card, 14px);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  height: 100%;
}

.fvd2-product-card:hover {
  box-shadow: 0 4px 20px rgba(2,132,199,0.1);
  transform: translateY(-2px);
}

/* Invisible full-area link — sits behind action buttons */
.fvd2-product-card__link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  cursor: pointer;
}

/* Image area — fixed aspect ratio so real product photos (which arrive in
   wildly different native ratios: square spools, tall spray cans, etc.)
   never distort card/row heights against object-fit:contain. */
.fvd2-product-card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fvd2-product-card__img a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.fvd2-product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.3s;
}

.fvd2-product-card:hover .fvd2-product-card__img img {
  transform: scale(1.04);
}

.fvd2-product-card__img-placeholder {
  width: 42px;
  height: 42px;
  color: var(--color-subtle, #94a3b8);
}

/* Sale / featured / new badges overlaid on the image corner */
.fvd2-product-card__badges {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.fvd2-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.fvd2-badge--new {
  background: var(--color-primary-lt, #e0f2fe);
  color: var(--color-primary, #0369a1);
}

.fvd2-badge--sale {
  background: #fee2e2;
  color: #dc2626;
}

.fvd2-badge--featured {
  background: #fef3c7;
  color: #b45309;
}

/* Body */
.fvd2-product-card__body {
  padding: 0.85rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fvd2-product-card__cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
}

.fvd2-product-card__name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}

.fvd2-product-card__name a {
  color: var(--color-dark, #0f172a);
  text-decoration: none;
}

.fvd2-product-card:hover .fvd2-product-card__name a {
  color: var(--color-primary, #0369a1);
}

.fvd2-product-card__note {
  font-size: 11px;
  color: var(--color-subtle, #94a3b8);
  font-family: 'Courier New', monospace;
}

/* Footer: price + button — must be above the overlay */
.fvd2-product-card__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.fvd2-product-card__price {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-dark, #0f172a);
  letter-spacing: -0.02em;
}

.fvd2-product-card__price .woocommerce-Price-amount {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.fvd2-product-card__footer .button.add_to_cart_button,
.fvd2-product-card__footer a.button {
  position: relative;
  z-index: 2;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem !important;
  font-size: 12px !important;
  border-radius: var(--radius-sm, 6px) !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.fvd2-product-card__footer .button.add_to_cart_button svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

/* "Inquiry" fallback link shown for out-of-stock / price-on-request items */
.fvd2-loop-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  background: var(--color-primary, #0369a1);
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm, 6px);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-blue, 0 4px 20px rgba(2,132,199,0.28));
  transition: background 0.15s;
}

.fvd2-loop-btn:hover {
  background: var(--color-primary-dk, #075985);
  color: #fff;
}

/* Product specification table */
.fvd-spec { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.fvd-spec th, .fvd-spec td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid #e2e8f0; }
.fvd-spec th { background: #0f172a; color: #fff; font-weight: 600; }
.fvd-spec tr:nth-child(even) td { background: #f8fafc; }
.fvd-spec td:first-child { color: #475569; width: 45%; }
.fvd-spec td:last-child { font-weight: 600; color: #0f172a; }

/* Genuine-parts guarantee block (USP: authentic vs counterfeit) */
.fvd2-guarantee { margin-top: 1.5rem; padding: 1.25rem 1.4rem; border: 1px solid #dbeafe; background: linear-gradient(180deg,#f5faff,#fff); border-radius: 16px; }
.fvd2-guarantee__head { display: flex; gap: .85rem; align-items: flex-start; }
.fvd2-guarantee__icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: #0369a1; color: #fff; }
.fvd2-guarantee__head strong { display: block; font-size: 1rem; font-weight: 700; color: #0f172a; letter-spacing: -.01em; }
.fvd2-guarantee__head p { margin: .25rem 0 0; font-size: .85rem; line-height: 1.55; color: #475569; }
.fvd2-guarantee__list { list-style: none; margin: 1rem 0 0; padding: .9rem 0 0; border-top: 1px solid #e2e8f0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; }
.fvd2-guarantee__list li { position: relative; padding-left: 1.4rem; font-size: .85rem; font-weight: 500; color: #334155; line-height: 1.4; }
.fvd2-guarantee__list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #0369a1; font-weight: 800; }
@media (max-width: 480px) { .fvd2-guarantee__list { grid-template-columns: 1fr; } }

/* Repair-service cross-sell card on product pages */
.fvd2-repair-xsell { display: flex; align-items: center; gap: .85rem; margin-top: 1rem; padding: .9rem 1.1rem; border: 1px solid #e2e8f0; border-radius: 14px; text-decoration: none; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.fvd2-repair-xsell:hover { border-color: #0369a1; box-shadow: 0 4px 16px rgba(2,132,199,.1); transform: translateY(-1px); }
.fvd2-repair-xsell__icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #0f172a; color: #fff; }
.fvd2-repair-xsell__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fvd2-repair-xsell__text strong { font-size: .9rem; color: #0f172a; font-weight: 700; }
.fvd2-repair-xsell__text > span { font-size: .8rem; color: #64748b; line-height: 1.4; }
.fvd2-repair-xsell__arrow { flex-shrink: 0; color: #0369a1; transition: transform .2s; }
.fvd2-repair-xsell:hover .fvd2-repair-xsell__arrow { transform: translateX(3px); }

/* Quantity input on single product pages: Astra's default width (~50px) is too
   narrow to fit the typed digit next to the number-input spinner, so the value
   was effectively invisible. Widen it and confirm text colour/size explicitly. */
.single-product .quantity input.qty {
	width: 4.5rem;
	min-width: 4.5rem;
	height: 2.75rem;
	font-size: 15px;
	color: #0f172a;
	text-align: center;
	padding: 0.5rem 0.25rem;
}

/* Add-to-cart form: quantity + button are both block-level by default, so
   they stack vertically. Put them side by side instead. */
.single-product form.cart {
	display: flex !important;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
}
.single-product form.cart .quantity {
	flex-shrink: 0;
	margin: 0 !important;
}
.single-product form.cart .single_add_to_cart_button {
	margin: 0 !important;
}
