/* ════════════════════════════════
   home.css — Home page styles
   ════════════════════════════════ */

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, var(--ord), var(--or) 50%, var(--orl));
  padding: 48px 18px 68px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 50px; background: var(--bg); clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-r { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.06); pointer-events: none; }
.hero-r1 { width: 200px; height: 200px; top: -60px; right: -40px; }
.hero-r2 { width: 100px; height: 100px; bottom: 40px; left: 10px; }
.hero h1 {
  font-weight: 900; font-size: clamp(1.7rem, 6vw, 2.8rem); color: #fff;
  line-height: 1.2; text-shadow: 0 2px 16px rgba(0,0,0,0.2); margin-bottom: 8px;
}
.hero p { color: rgba(255,255,255,0.9); font-size: .9rem; max-width: 380px; margin: 0 auto 24px; line-height: 1.65; }
.hero-stats { display: flex; justify-content: center; gap: 32px; margin-bottom: 28px; }
.hs { display: flex; flex-direction: column; align-items: center; }
.hs-num { font-family: 'Oswald', 'Noto Sans Thai', sans-serif; font-weight: 700; font-size: 2rem; color: #fff; line-height: 1; }
.hs-div { width: 1px; height: 40px; background: rgba(255,255,255,0.25); align-self: center; }
.hs-lbl { font-size: .7rem; color: rgba(255,255,255,0.8); margin-top: 4px; font-weight: 500; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--ord); font-weight: 700; font-size: .92rem;
  padding: 12px 28px; border-radius: 50px; border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); transition: transform .2s; text-decoration: none;
}
.hero-cta:hover { transform: translateY(-3px); }

/* ── CATEGORY SECTION ── */
.cat-section { padding: 16px 16px 0; }
@media (min-width: 961px) {
  .cat-section { max-width: 960px; margin: 0 auto; }
}
.cat-title {
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.cat-row { display: flex; flex-direction: column; gap: 10px; }
.cat-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-item {
  cursor: pointer; border-radius: 14px; overflow: hidden;
  border: 2px solid rgba(76,29,149,0.18); background: var(--card);
  transition: border-color .2s, transform .18s;
}
.cat-item:hover { border-color: var(--or); transform: scale(1.02); }
.cat-img { width: 100%; display: block; }
.cat-img img { width: 100%; height: auto; display: block; object-fit: cover; }

/* ── SECTION TITLE (shared: หมวดหมู่ / ไอดีเกมทั้งหมด) ── */
.title-bar {
  width: 5px; height: 22px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--or), var(--ord));
}
.title-txt {
  font-size: 1.05rem; font-weight: 800; color: var(--white);
  display: flex; flex-direction: column; line-height: 1.15;
}
.title-txt small {
  font-size: .62rem; font-weight: 700; color: var(--or);
  letter-spacing: .12em; margin-top: 2px;
}

/* ── ALL IDS TITLE ── */
.all-ids-title { margin: 20px 0 0; display: flex; align-items: center; gap: 10px; }

/* ── PRODUCT GRID ── */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding-bottom: 60px;
}
@media (min-width: 961px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

/* ── SLIDE-IN ANIMATION ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-44px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* เริ่มต้น hidden — รอ observer */
.card {
  opacity: 0;
  transform: translateX(-44px);
}

/* เข้า viewport → animate */
.card.slide-in {
  animation: slideInLeft .42s cubic-bezier(.25,.46,.45,.94) both;
}
.card.slide-in:nth-child(even) { animation-delay: .09s; }

/* ไม่มี slide-out — เลื่อนขึ้นไม่ต้องซ่อน */

/* ── PRODUCT CARD ── */
.card {
  background: #fff; border-radius: 18px; overflow: hidden;
  border: 1.5px solid rgba(0,0,0,0.07);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  text-decoration: none; color: inherit; display: block; cursor: pointer;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  border-color: rgba(76,29,149,0.3);
}
.card-img-wrap { padding: 10px 10px 0; position: relative; }
.card-img {
  width: 100%; aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e8edf5, #f0f4fb);
  border-radius: 12px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img svg { width: 44px; height: 44px; opacity: .25; }
.card-price-badge {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(255,255,255,0.95); color: var(--or);
  font-family: 'Oswald', 'Noto Sans Thai', sans-serif; font-weight: 700; font-size: .78rem;
  padding: 4px 10px; border-radius: 20px; backdrop-filter: blur(4px);
  line-height: 1.3; z-index: 2;
}
.stag {
  position: absolute; top: 5px; right: 5px;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 50px;
  font-size: .5rem; font-weight: 700; line-height: 1.6; backdrop-filter: blur(6px);
}
.stag.avail { background: rgba(22,163,74,0.85); color: #fff; }
.stag.sold  { background: rgba(192,57,43,0.85);  color: #fff; }
.badge-new {
  position: absolute; top: 8px; left: 8px;
  background: var(--or); color: #fff;
  font-size: .6rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; letter-spacing: .04em;
}
.card-stats {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex; gap: 5px; border-radius: 0 0 12px 12px;
}
.cs {
  display: flex; align-items: center; gap: 3px;
  font-size: .62rem; font-weight: 700; color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.3); border-radius: 4px; padding: 2px 6px; backdrop-filter: blur(4px);
}
.card-body { padding: 10px 12px 12px; }
.card-id   {
  font-weight: 700; font-size: .98rem; color: #1a1a1a; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
  font-size: .75rem; color: rgba(0,0,0,0.4); line-height: 1.45; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.1em;
}
.card-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-stock { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.stock-label { font-size: .66rem; font-weight: 600; color: rgba(0,0,0,0.45); }
.stock-num   { font-size: .92rem; font-weight: 800; }
.card-stock.avail .stock-num { color: #16A34A; }
.card-stock.sold  .stock-num { color: #C0392B; }
.card-viewlink {
  display: flex; align-items: center; gap: 4px;
  font-size: .74rem; font-weight: 700; color: var(--or);
  transition: gap .18s;
}
.card-viewlink svg { flex-shrink: 0; }
.card:hover .card-viewlink { gap: 6px; }

@media (max-width: 500px) { .grid { grid-template-columns: repeat(2,1fr); gap: 10px; } }
