/******* Do not edit this file *******
Simple Custom CSS and JS - by Silkypress.com
Saved: Mar 10 2026 | 08:10:28 */
.products-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.title-product {
    color: var(--primary-color);
    margin: 12px 0;
    min-height: 2.2em;
    line-height: 0.8;
}

/* wrapper คุมพื้นที่ overlay */
.image-wrapper {
  position: relative;
  width: 100%;
}

.product-crop-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center; /*เลือกจุดครอบ center, top, bottom*/
    cursor: pointer;
}

/* กล่องรายละเอียด (ซ่อนเริ่มต้น) */
.product-detail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60%;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;

  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

/* ตอนเปิด */
.products-card.active .product-detail {
  transform: translateY(0);
  opacity: 1;
}

/* ตัวหนังสือ */
/*.product-detail li {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-dark);
}*/

/* animation ธรรมชาติ */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-detail::-webkit-scrollbar {
  width: 4px;
}
.product-detail::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}

.product-cards {
    position: relative;
    border-radius: 12px;
    margin: 0;
    color: var(--text-light);
    transition: var(--transition);
    cursor: pointer;
    min-height: 240px;
    min-width: calc(25% - 16px);
    box-sizing: border-box;
    flex-shrink: 0; /* ห้ามหด */
    height: 256px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    object-fit: cover;
}

/* Container หลัก */
.product-layout {
    display: grid;
    /* สร้าง Grid พื้นฐานเป็น 20 คอลัมน์ย่อย (เพื่อให้หารทั้ง 4 และ 5 ลงตัว) */
    grid-template-columns: repeat(20, 1fr); 
    gap: 20px;
    padding: 20px 0;
}

/* แถวที่ 1: ให้แต่ละการ์ดกินพื้นที่ 5 ส่วน (20 / 4 = 5) */
.product-layout .product-cards:nth-child(-n+4) {
    grid-column: span 5;
}

/* แถวที่ 2: ให้แต่ละการ์ดกินพื้นที่ 4 ส่วน (20 / 5 = 4) */
.product-layout .product-cards:nth-child(n+5) {
    grid-column: span 4;
}

/* Container ของรูปภาพเพื่อทำ Relative Positioning */

/* ส่วนของข้อความ Overlay ทับรูป */
.product-card__overlay {
    position: absolute;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    
    /* พื้นหลังสีขาวโปร่งแสงแบบ Glassmorphism */
    background: rgba(255, 255, 255, 0.7); 
    backdrop-filter: blur(8px); /* ทำให้รูปหลังข้อความเบลอ ดูหรูหรา */
    -webkit-backdrop-filter: blur(8px);
    
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.product-card__overlay h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.product-card__details {
    padding: 20px;
    flex-grow: 1;
}

/* --- Responsive สำหรับมือถือ --- */
@media (max-width: 1024px) {
    /* Tablet: ปรับเป็นแถวละ 3 หรือ 2 ตามความเหมาะสม */
    .product-layout .product-cards:nth-child(n) {
        grid-column: span 10; /* แถวละ 2 คอลัมน์ */
    }
}

@media (max-width: 600px) {
    /* Mobile: แถวละ 1 คอลัมน์ */
    .product-layout .product-cards:nth-child(n) {
        grid-column: span 20;
    }
}