/* ============================================================
   Bisyor — Avito-style listing card refresh (2026-04-29)
   Overrides .product_mains / .product_item / .product_text /
   .price_product / .address_product / .favoruites_product
   to give the marketplace cards a modern, mobile-first look.

   Dark mode: respects an existing [data-theme="dark"] / .dark
   ancestor (matches the project's dark mode implementation),
   plus prefers-color-scheme as a passive fallback.

   This file is INTENTIONALLY scoped to listing cards only.
   Drop the link from app.blade.php to revert in 1 second.
   ============================================================ */

/* ── Card variables ────────────────────────────────────────── */
:root {
  --card-radius: 14px;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.06);
  --card-shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.10);
  --card-text: #0f172a;
  --card-muted: #64748b;
  --card-category: #2563eb;
  --card-category-bg: rgba(37, 99, 235, 0.08);
  --card-price: #0f172a;
  --card-price-old: #94a3b8;
  --card-heart-bg: rgba(255, 255, 255, 0.92);
  --card-heart-fg: #475569;
  --card-heart-active: #ef4444;
}

[data-theme="dark"], .dark {
  --card-bg: #1f2937;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
  --card-text: #f1f5f9;
  --card-muted: #94a3b8;
  --card-category: #60a5fa;
  --card-category-bg: rgba(96, 165, 250, 0.15);
  --card-price: #f1f5f9;
  --card-price-old: #64748b;
  --card-heart-bg: rgba(31, 41, 55, 0.92);
  --card-heart-fg: #cbd5e1;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.product_mains {
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}

.product_mains:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-radius: var(--card-radius);
}

.product_item {
  display: block;
  text-decoration: none;
  border-radius: 0;
  overflow: hidden;
  color: inherit;
}

/* ── Image ─────────────────────────────────────────────────── */
.product_item > img {
  width: 100%;
  object-fit: cover;
  height: 200px;
  border-radius: 0;
  display: block;
  background: linear-gradient(135deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
}

[data-theme="dark"] .product_item > img,
.dark .product_item > img {
  background: linear-gradient(135deg, #1e293b 25%, #334155 50%, #1e293b 75%);
}

/* ── Text body ─────────────────────────────────────────────── */
.product_text {
  padding: 12px 14px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Category — chip-style instead of plain blue text */
.product_text > span {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px 0 8px;
  font-size: 12px;
  line-height: 18px;
  color: var(--card-category);
  background-color: var(--card-category-bg);
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  overflow: hidden;
}

/* Title — tighter, cleaner */
.product_text .product_text_h4,
.product_text h4 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--card-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: auto;
  min-height: 42px;
  max-height: 42px;
}

/* Price block — make it pop */
.price_product {
  margin: 0 0 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price_product b {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--card-price);
  padding: 0;
  min-height: auto;
}

.price_product i {
  font-size: 13px;
  line-height: 1.2;
  color: var(--card-price-old);
  text-decoration: line-through;
  font-style: normal;
  min-height: auto;
}

/* "Negotiable" line — tuck it under price compactly */
.product_text .negotiat {
  font-size: 12px;
  line-height: 1.3;
  color: var(--card-muted);
  margin: -4px 0 8px;
  min-height: 0;
}

.product_text .negotiat:empty {
  display: none;
}

/* Address — same row, smaller, no big left padding */
.address_product {
  font-size: 12px;
  line-height: 1.4;
  color: var(--card-muted);
  padding-left: 18px;
  margin-bottom: 0;
  background-position: 0 50%;
  background-size: 12px 14px;
}

/* ── Heart / favorite — round chip with bg ─────────────────── */
.product_mains .favoruites_product,
.favoruites_product {
  width: 32px;
  height: 32px;
  top: 10px;
  right: 10px;
  background-color: var(--card-heart-bg);
  background-size: 18px 18px;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform .15s ease, background-color .15s ease;
}

.favoruites_product:hover {
  transform: scale(1.08);
}

.favoruites_product:active {
  transform: scale(0.95);
}

/* ── Premium / Fix / Quick badges — refresh ────────────────── */
.product_mains .premium,
.product_mains .fastening,
.product_mains .ups_pre {
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* ── Mobile — tighter spacing, smaller image ───────────────── */
@media (max-width: 768px) {
  .product_item > img {
    height: 160px;
  }
  .product_text {
    padding: 10px 12px 12px;
  }
  .product_text .product_text_h4,
  .product_text h4 {
    font-size: 14px;
    min-height: 38px;
    max-height: 38px;
  }
  .price_product b {
    font-size: 16px;
  }
}

/* ── Section wrappers that pad the card grid extra ─────────── */
section.last_ads .lasts_main .product_mains {
  padding: 0;
}
