/* =========================================================
   Suriya9 — สินค้า: หน้าหีบศพ (Coffin products)
   โหลดเฉพาะ template-product-*.php — คลาส .cf-* (self-contained)
   ========================================================= */

.cf {
  position: relative;
  background: #fff;
}

/* ===== HERO (368px + เฟดขาวด้านล่าง) ===== */
.cf-hero {
  position: relative;
  height: 368px;
  overflow: hidden;
}
.cf-hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.cf-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 261px;
  background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
}

/* ===== TITLE (ยกขึ้นทับเฟด) ===== */
.cf-top {
  position: relative;
  z-index: 10;
  margin-top: -80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}
.cf-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 1.1;
  color: #8c0e0f;
  text-align: center;
  white-space: nowrap;
}

/* ===== เส้นคั่นลายทอง ===== */
.cf-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 64px;
  width: 100%;
}
.cf-divider .ln {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(to right, #bd9a4b, #d1ab35);
}
.cf-divider__c {
  flex-shrink: 0;
  width: 150px;
  height: 73px;
  overflow: hidden;
  position: relative;
  transform: rotate(180deg);
}
.cf-divider__c img {
  position: absolute;
  height: 410.83%;
  left: -52.01%;
  top: -98.9%;
  width: 200.78%;
  max-width: none;
}

/* ===== สินค้า (การ์ดหีบศพ 5 คอลัมน์) ===== */
.cf-products {
  padding: 48px 64px;
  background: #fff;
}
.cf-subtitle {
  margin: 0 0 40px;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.6;
  color: #545454;
}
.cf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.cf-grid + .cf-grid { margin-top: 24px; }

.cf-card {
  position: relative;
  aspect-ratio: 242 / 233;
  border-radius: 20px;
  border: 2px solid #ffd066;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 16px;
}
.cf-card__img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cf-card__img img {
  object-fit: contain;
  max-height: 65%;
  max-width: 90%;
}
.cf-card__label {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  color: #000;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  padding: 0 8px;
}

/* ===== โปรโมชั่น ===== */
.cf-promo {
  padding: 48px 0;
}
.cf-promo-head {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.cf-promo-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.2;
  color: #8c0e0f;
  text-align: center;
}
.cf-promo-sub {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.6;
  color: #545454;
  text-align: center;
}
.cf-promo-cards {
  margin-top: 40px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 64px;
  flex-wrap: wrap;
}
.cf-promo-card {
  position: relative;
  width: 400px;
  flex-shrink: 0;
  border: 4px solid #fff;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}
.cf-promo-card--h518 { height: 518px; }
.cf-promo-card--h566 { height: 566px; }
.cf-promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cf-promo-card img.overlay {
  position: absolute;
  inset: 0;
}
.cf-dots {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}
.cf-dots img {
  height: 10px;
  width: 46px;
}

@media (max-width: 1100px) {
  .cf-grid { grid-template-columns: repeat(3, 1fr); }
}

/* โปรโมชั่นท้ายหน้าสินค้า — เว้นที่ว่างด้านล่างก่อน footer */
.cf > .s9-promo:last-child {
  padding-bottom: 160px;
}

/* ===== หน้าหมวดสินค้าที่ยังไม่มีสินค้า ===== */
.cf-empty { margin: 0; padding: 48px 16px; text-align: center; font-size: 18px; color: #6b6b6b; }
.cf-empty a { color: #94641e; text-decoration: underline; }
