/* ============================================================
   fixes.css v5 — FY Bedding Product Card (ENHANCED)
   Loads LAST after shared-v2.css / page_components.css
   Design Polish v25 — a11y, touch targets, focus-visible
   ============================================================ */

/* ── 1. Product Card Container ──── */
.product-card,
a.product-card {
  display: flex !important;
  flex-direction: column !important;
  background: #FFFEFA !important;
  border: 1px solid #EBE5DC !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer !important;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s cubic-bezier(0.4,0,0.2,1) !important;
  box-shadow: 0 1px 4px rgba(61,42,28,0.04), 0 4px 12px rgba(61,42,28,0.04) !important;
}

.product-card:hover,
a.product-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 8px 24px rgba(61,42,28,0.07), 0 20px 48px rgba(61,42,28,0.07) !important;
}

.product-card:focus-visible,
a.product-card:focus-visible {
  outline: 2px solid #9D6238;
  outline-offset: 2px;
  border-radius: 16px;
}

/* ── 2. Product Image ──── */
.product-card-img {
  width: 100% !important;
  /* Modern browsers: native aspect-ratio */
  aspect-ratio: 4 / 3 !important;
  /* WeChat / old browser fallback: padding-bottom hack */
  height: 0 !important;
  padding-bottom: 75% !important;  /* 3/4 = 75% for 4:3 ratio */
  background-size: cover !important;
  background-position: center !important;
  background-color: #E4DFD4 !important;
  background-repeat: no-repeat !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: none !important;
  position: relative !important;
  display: block !important;
  flex-shrink: 0 !important;
  transition: transform 0.6s ease !important;
}

.product-card:hover .product-card-img {
  transform: scale(1.03) !important;
}

/* ── 3. Product Info ──── */
.product-card-info {
  padding: 18px 20px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  gap: 4px !important;
  background: transparent !important;
}

/* ── 4. Category Label ──── */
.product-card-cat {
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #B2956E !important;
  margin: 0 0 2px 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

/* ── 5. Product Name ──── */
.product-card-name {
  font-family: 'Cormorant Garamond', 'Georgia', serif !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  color: #3D2A1C !important;
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}

/* ── 6. Price ──── */
.product-card-price {
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #9D8B7B !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
}

/* ── 7. Get Quote Button ──── */
.card-quote-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  margin-top: 14px !important;
  padding: 10px 18px !important;
  border: 1px solid #DDD5C8 !important;
  border-radius: 8px !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #9D8B7B !important;
  background: transparent !important;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1) !important;
  text-decoration: none !important;
  align-self: flex-start !important;
  min-height: 44px; /* a11y touch target */
  min-width: 44px;
}

.card-quote-btn:hover {
  border-color: #3D2A1C !important;
  color: #3D2A1C !important;
  background: #F7F3EE !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(61,42,28,0.08);
}

.card-quote-btn:active {
  transform: scale(0.97);
}

.card-quote-btn:focus-visible {
  outline: 2px solid #9D6238;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── 8. Product Grid ──── */
.product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 28px !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
}

/* ── 9. Responsive ──── */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  .product-card-name { font-size: 18px !important; }
  .product-card-info { padding: 14px 16px 18px !important; }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 16px !important;
  }
  .product-card-name { font-size: 18px !important; }
  .product-card-info { padding: 14px 16px 18px !important; }
  .card-quote-btn { width: 100% !important; justify-content: center !important; align-self: stretch !important; }
}

@media (max-width: 375px) {
  .product-grid {
    padding: 0 8px !important;
    gap: 12px !important;
  }
  .product-card-name { font-size: 17px !important; }
  .product-card-info { padding: 12px 14px 16px !important; }
  .product-card-cat { font-size: 10px !important; }
  .card-quote-btn { padding: 10px 14px !important; font-size: 11px !important; }
}
