/* ==============================================
   Unified Product Card — urun-card.css
   Used: temahome, kategoridetay, arama, magazadetay
   ============================================== */

:root {
  --th-primary:       #2E7D32;
  --th-primary-light: #66BB6A;
  --th-primary-dark:  #1B5E20;
  --th-secondary:     #FFA726;
  --th-bg-gray:       #F0EDE8;
  --th-card:          #FFFFFF;
  --th-text:          #212121;
  --th-text-secondary:#757575;
  --th-text-white:    #FFFFFF;
  --th-error:         #E53935;
  --th-border:        #E0E0E0;
  --th-shadow-lg:     0 14px 40px rgba(0,0,0,0.12);
  --th-radius:        14px;
  --th-radius-sm:     8px;
  --th-star:          #FFC107;
  --th-star-muted:    #E0E0E0;
}

/* ── Card shell ─────────────────────────────── */
.th-product-card {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  transition: transform 220ms, box-shadow 220ms, border-color 220ms;
  position: relative;
}
.th-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--th-shadow-lg);
  border-color: var(--th-primary-light);
}

/* ── Image area ─────────────────────────────── */
.th-product-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--th-bg-gray);
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.th-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  box-sizing: border-box;
  transition: transform 400ms;
}
.th-product-card:hover .th-product-card__media img {
  transform: scale(1.06);
}

/* ── Badges — Unified Premium Style ────────────────── */
.th-product-labels {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  pointer-events: none;
}
.th-label {
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--th-primary-dark) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: var(--th-radius-sm) !important;
  border: 1px solid var(--th-border) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  text-transform: uppercase !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  line-height: 1 !important;
}
.th-label i {
  color: var(--th-primary) !important;
}

/* ── Free-shipping — top-right ──────────────── */
.th-product-card__shipping {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--th-primary-dark) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  border-radius: var(--th-radius-sm) !important;
  border: 1px solid var(--th-border) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  pointer-events: none;
  white-space: nowrap;
}
.th-product-card__shipping i {
  color: var(--th-primary) !important;
}

/* ── Body ───────────────────────────────────── */
.th-product-card__body {
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* ── Title ──────────────────────────────────── */
.th-product-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  min-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.th-product-card__title a {
  color: var(--th-text);
  text-decoration: none;
  transition: color 180ms;
}
.th-product-card__title a:hover { color: var(--th-primary); }

/* ── Rating row ─────────────────────────────── */
.th-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 14px;
}
.th-rating__stars {
  position: relative;
  display: inline-flex;
  color: var(--th-star-muted);
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1;
}
.th-rating__stars::before {
  content: '\f005 \f005 \f005 \f005 \f005';
  font-family: 'FontAwesome';
  position: absolute;
  top: 0;
  left: 0;
  color: var(--th-star);
  white-space: nowrap;
  overflow: hidden;
  width: calc(var(--rating, 0) / 5 * 100%);
  letter-spacing: 1px;
}
.th-rating__stars i { opacity: 0; }
.th-rating__score {
  font-size: 11px;
  font-weight: 700;
  color: var(--th-text);
  line-height: 1;
}
.th-rating__count {
  font-size: 11px;
  color: var(--th-text-secondary);
  line-height: 1;
}
.th-rating__count--empty {
  font-size: 10px;
  color: var(--th-text-secondary);
  font-style: italic;
}

/* ── Store name (no-review state, below title) ─ */
.th-product-card__store {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--th-text-secondary);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 180ms;
}
.th-product-card__store:hover { color: var(--th-primary); }
.th-product-card__store i {
  font-size: 10px;
  flex-shrink: 0;
  color: var(--th-text-secondary);
}

/* ── Price row ──────────────────────────────── */
.th-product-card__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1;
}
/* urunfiyatbelirle() outputs <ins><span class="woocommerce-Price-amount"><bdi>X TL</bdi></span></ins> */
.th-product-card__price ins {
  text-decoration: none;
}
.th-product-card__price ins,
.th-product-card__price .woocommerce-Price-amount,
.th-product-card__price bdi {
  font-size: 17px;
  font-weight: 700;
  color: var(--th-primary-dark);
  text-decoration: none;
}
.th-product-card__price del {
  font-size: 12px;
  font-weight: 400;
  color: var(--th-text-secondary);
  text-decoration: line-through;
}

/* ── Al-Öde pill ────────────────────────────── */
.th-product-card__alode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #FFF8E1;
  color: #7B5800;
  border: 1px solid #FFD54F;
  border-radius: var(--th-radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  width: 100%;
  box-sizing: border-box;
}
.th-product-card__alode i { color: #F9A825; }

/* ── CTA button ─────────────────────────────── */
.th-product-card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  margin-top: auto;
  margin-left: -12px;
  margin-right: -12px;
  background: var(--th-primary);
  color: var(--th-text-white) !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: background 180ms;
  border-radius: 0 0 var(--th-radius) var(--th-radius);
  flex-shrink: 0;
  line-height: 1;
}
.th-product-card__cta:hover {
  background: var(--th-primary-dark);
  color: var(--th-text-white) !important;
}

/* ── Grid equal-height support (Bootstrap col wrapper) */
.products.elements-grid .product-grid-item {
  display: flex;
  padding: 8px;
}
.products.elements-grid .product-grid-item .th-product-card {
  flex: 1;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
  .th-product-card__price ins,
  .th-product-card__price .woocommerce-Price-amount,
  .th-product-card__price bdi { font-size: 15px; }
  .th-product-card__title     { font-size: 12px; min-height: 32px; }
  .th-product-card__cta       { font-size: 12px; padding: 9px 10px; }
  .th-product-card__shipping  { font-size: 9px; }
}
