/* ══════════════════════════════════════════════════════
   استوردلي برو v8 — Complete CSS Fix
   ══════════════════════════════════════════════════════ */

/* ── Fix: logo Pro Pro removed ── */
body.lang-en .logo-brand-name::after { content: '' !important; display: none !important; }
body.lang-zh .logo-brand-name::after { content: '' !important; display: none !important; }

/* ══ PRODUCT CARDS — uniform size, clickable ══ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
/* IMPORTANT: display:block ensures anchor tag is clickable */
a.prod-card, .prod-card {
  display: block;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid #f0f0f0;
  cursor: pointer;
}
a.prod-card:hover, .prod-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(26,58,107,.15);
  border-color: #cbd5e1;
}
/* Image wrapper — fixed 4:3 ratio */
.prod-img-wrap {
  /* WAVE_IMG_SQUARE: إطار مربّع 1:1 — يستوعب الصور الطويلة والعريضة */
  position: relative;
  width: 100%;
  padding-bottom: 133.33% /* WAVE_IMG_RATIO 3:4 */;
  overflow: hidden;
  background: #ffffff;
  flex-shrink: 0;
}
.prod-img-wrap img {
  /* WAVE_IMG_UNIFY: contain — الصورة كاملة بلا قص */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform .35s ease;
  pointer-events: none; /* ensure clicks pass through to anchor */
}
a.prod-card:hover .prod-img-wrap img,
.prod-card:hover .prod-img-wrap img { transform: scale(1.06); }

/* Product info — fixed height */
.prod-info {
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  min-height: 90px;
}
.prod-name {
  font-weight: 700;
  font-size: .9rem;
  color: #1a3a6b;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  flex: 1;
}
.prod-price {
  font-size: .82rem;
  color: #6b7280;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}
.prod-price strong {
  color: #e63946;
  font-size: 1rem;
  font-weight: 900;
}
/* NOTE: NO CSS ::before for price — PHP handles translation */

/* ══ AUCTION CARDS — uniform size ══ */
.auctions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.auction-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border: 1.5px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  transition: transform .22s, box-shadow .22s;
}
.auction-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(26,58,107,.15);
}
/* Auction image — fixed 16:9 */
.auction-img {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  background: #f8fafc;
  flex-shrink: 0;
}
.auction-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.auction-card:hover .auction-img img { transform: scale(1.04); }
.auction-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.auction-info h4 {
  font-weight: 700;
  margin-bottom: 10px;
  color: #1a3a6b;
  font-size: .9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.auction-timer {
  text-align: center;
  background: #1a3a6b;
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2px;
}
.auction-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: .85rem;
  color: #6b7280;
}
.auction-price strong { color: #e63946; font-size: 1.1rem; font-weight: 900; }
.btn-sm-full {
  display: block;
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
  font-family: Cairo, Arial, sans-serif;
  margin-top: auto;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn-disabled { background: #f3f4f6; color: #9ca3af; cursor: default; }
.auction-ended .auction-img img { filter: grayscale(.5); }
.auction-ended .auction-info h4 { color: #6b7280; }

/* ══ 404 / Error page ══ */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: #f8fafc;
}
.error-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
  max-width: 520px;
  width: 100%;
}
.error-code {
  font-size: 7rem;
  font-weight: 900;
  color: #1a3a6b;
  line-height: 1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #1a3a6b, #2196F3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-icon { font-size: 4rem; margin-bottom: 16px; }
.error-title { font-size: 1.4rem; font-weight: 900; color: #1a3a6b; margin-bottom: 10px; }
.error-sub { color: #6b7280; font-size: .95rem; margin-bottom: 28px; line-height: 1.7; }
.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ══ Responsive ══ */
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .auctions-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .auctions-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 380px) {
  .products-grid { grid-template-columns: 1fr; }
  .auctions-grid { grid-template-columns: 1fr; }
}
