/*
 * products.css — Products Showcase (optional module, index.php บนสุด)
 * เปิดใช้ผ่าน $cfg['products'] ใน home_config.php (siam_render_products() ใน siam_lib.php)
 * โหลดแบบมีเงื่อนไขจาก index.php เอง (ไม่ได้อยู่ใน *_css_links() ที่ต้องเหมือนกันทุกเว็บ) —
 * ย้ายออกมาจาก stylesheet.css หลัก 2569-07-12 เพื่อให้ core stylesheet ของทั้ง 3 เว็บ sync กันง่ายขึ้น
 * (เดิมมีก้อนนี้ปนอยู่ ทั้งที่มีแค่ mitthai เว็บเดียวที่ใช้จริง)
 */

/* ===== PRODUCTS SHOWCASE (index.php บนสุด — สินค้าของบริษัท mitthai เฉพาะ) ===== */
.sa-products { margin-bottom: 28px; }
.sa-product {
  display: flex; gap: 0; background: #fff; border: 1px solid #E2E8F0;
  border-radius: var(--mit-radius); overflow: hidden; margin-bottom: 14px;
  transition: box-shadow var(--mit-transition);
}
.sa-product:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }
.sa-product-img { flex: none; width: 34%; display: block; overflow: hidden; background: #EEF2F6; align-self: stretch; position: relative; }
.sa-product-img img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 150px; }
.sa-product-body { flex: 1; min-width: 0; padding: 16px 20px; display: flex; flex-direction: column; }
.sa-product-title { font-size: 18px; font-weight: 800; color: var(--mit-brand-coffee); margin: 0 0 3px; line-height: 1.25; }
.sa-product-sub { font-size: 13px; font-weight: 600; color: var(--mit-brand-primary); margin-bottom: 8px; }
.sa-product-desc {
  font-size: 13px; color: #4B5563; line-height: 1.6; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sa-product-cta {
  align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--mit-brand-primary);
  padding: 7px 16px; border-radius: 999px; text-decoration: none; transition: background .15s;
}
.sa-product-cta:hover { background: #184680; color: #fff; }

/* Featured (Genius Count) — flagship เด่นเต็มแถบ */
.sa-product--featured { border-left: 4px solid var(--mit-brand-accent); }
.sa-product--featured .sa-product-img { width: 44%; }
.sa-product--featured .sa-product-img img { min-height: 240px; }
.sa-product--featured .sa-product-body { padding: 22px 26px; }
.sa-product--featured .sa-product-title { font-size: 24px; }
.sa-product--featured .sa-product-sub { font-size: 14px; }
.sa-product--featured .sa-product-desc { font-size: 13.5px; -webkit-line-clamp: 5; }
.sa-product-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--mit-brand-accent); color: #1a1a1a; font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
@media (max-width: 680px) {
  .sa-product, .sa-product--featured { flex-direction: column; }
  .sa-product-img, .sa-product--featured .sa-product-img { width: 100%; }
  .sa-product-img img, .sa-product--featured .sa-product-img img { min-height: 0; aspect-ratio: 16/9; }
  /* featured: แสดงรูปเต็ม (ไม่ crop) ตามสัดส่วนจริง เพื่อให้ badge อยู่มุมพื้นขาวว่าง ไม่ทับตัวสินค้า/โลโก้ */
  .sa-product--featured .sa-product-img img { aspect-ratio: 519 / 400; object-fit: contain; background: #fff; }
  .sa-product--featured .sa-product-title { font-size: 20px; }
}
