/* ═══════════════════════════════════════════════════════════════
   หน้า "องค์ประกอบสปา" (/spa_element) — เฉพาะของที่หน้านี้ใช้
   ต้องโหลดหลัง onzon.css และ blocks.css

   ถ้าอันไหนหน้าอื่นเอาไปใช้ด้วย → ย้ายขึ้นไป blocks.css
   ═══════════════════════════════════════════════════════════════ */

/* ── องค์ประกอบหลักของสปา — การ์ด 8 ใบ (4 คอลัมน์ × 2 แถว) ──
   ไอคอนอยู่ในกรอบมนทางซ้าย · หัวข้อ+คำอธิบายทางขวา */
.el-core-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 🎛️ จำนวนคอลัมน์ */
  gap: clamp(12px, 1.4vw, 18px);
}
.el-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px 18px 20px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.el-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.el-card-ico {
  flex: 0 0 auto;
  width: 54px;   /* 🎛️ ขนาดกรอบไอคอน */
  height: 54px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 15px;
  background: var(--panel-2);
}
.el-card-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.el-card-text h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.45;
  margin-bottom: 7px;
}
.el-card-text p {
  font-size: 0.77rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ── จอกลาง/เล็ก ── */
@media (max-width: 1180px) {
  .el-core-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .el-core-grid {
    grid-template-columns: 1fr;
  }
  .el-card {
    padding: 15px;
  }
  .el-card-ico {
    width: 46px;
    height: 46px;
    padding: 8px;
  }
}

/* ── องค์ประกอบที่สมดุล — การ์ดใหญ่: รูปซ้าย + ข้อความขวา + คุณค่า 4 ข้อ ── */
.el-balance {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;   /* 🎛️ สัดส่วน รูป | ข้อความ */
  gap: clamp(18px, 2.4vw, 34px);
  align-items: center;
  padding: clamp(14px, 1.6vw, 20px);
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.el-balance-media img {
  width: 100%;
  aspect-ratio: 21 / 9;   /* 🎛️ สัดส่วนรูป (เลขหลังน้อย = เตี้ยลง) */
  object-fit: cover;
  border-radius: 15px;
  display: block;
}
.el-balance-text h2 {
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.45;
  margin-bottom: 9px;
}
.el-balance-text > p {
  font-size: 0.82rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* คุณค่า 4 ข้อ — มีเส้นคั่นระหว่างช่อง */
.el-values {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
}
.el-values li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 0 clamp(8px, 1vw, 16px);
  border-left: 1px solid var(--hair);
}
.el-values li:first-child {
  border-left: 0;
}
.el-values img {
  width: 38px;   /* 🎛️ ขนาดไอคอนคุณค่า */
  height: 38px;
  object-fit: contain;
  margin-bottom: 3px;
}
.el-values b {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}
.el-values small {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--ink-faint);
}

/* ── องค์ประกอบสู่ประสบการณ์สปา — แถวสูตร: การ์ด + การ์ด ... = ผลลัพธ์ ── */
.el-fx-row {
  display: flex;
  align-items: stretch;
  gap: clamp(6px, 0.8vw, 12px);
}
.el-fx-card,
.el-fx-result {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 16px;
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
/* การ์ดขั้นตอน — ภาพประกอบจาง ๆ อยู่มุมขวาล่าง (ส่งมาทาง --fx-img จาก view) */
.el-fx-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--hair);
}
/* ภาพประกอบมุมขวา — ไล่จางจากซ้ายให้กลืนกับพื้นการ์ด
   ⚠️ ดีไซน์ต้นแบบใช้ "ภาพวาดพื้นโปร่งใส" แต่รูปชั่วคราวเป็นรูปถ่ายสี่เหลี่ยม
      ถ้าใช้ contain จะเห็นเป็นกล่องรูปแปะอยู่ → ใช้ cover + mask ไล่จางแทน */
.el-fx-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 56%;            /* 🎛️ ความกว้างพื้นที่ภาพ */
  background: var(--fx-img) center right / cover no-repeat;
  opacity: 0.42;         /* 🎛️ ความเข้มของภาพประกอบ */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 62%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 62%);
  pointer-events: none;
}
.el-fx-card h3,
.el-fx-card ul {
  position: relative;
  z-index: 1;
}
.el-fx-card h3 {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
  margin-bottom: 8px;
}
.el-fx-card ul,
.el-fx-result ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.el-fx-card li,
.el-fx-result li {
  position: relative;
  padding-left: 12px;
  font-size: 0.72rem;
  line-height: 1.6;
}
.el-fx-card li::before,
.el-fx-result li::before {
  content: "•";
  position: absolute;
  left: 0;
}
.el-fx-card li {
  color: var(--ink-soft);
}

/* เครื่องหมาย + และ = ระหว่างการ์ด */
.el-fx-op {
  flex: 0 0 auto;
  align-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--panel);
  color: var(--ink-faint);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}
.el-fx-op.is-eq {
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.25rem;
}

/* การ์ดผลลัพธ์ — พื้นเขียวเข้ม */
.el-fx-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-ink);
}
.el-fx-result h3 {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}
.el-fx-result img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.el-fx-result ul {
  flex-flow: row wrap;
  justify-content: center;
  gap: 2px 14px;
}
.el-fx-result li {
  color: inherit;
  opacity: 0.92;
}

/* ── จอกลาง/เล็ก ── */
@media (max-width: 1180px) {
  .el-balance {
    grid-template-columns: 1fr;
  }
  /* แถวสูตรยาวเกินจอ → พับเป็น 2 แถว (เครื่องหมายยังอยู่ระหว่างการ์ดเหมือนเดิม) */
  .el-fx-row {
    flex-wrap: wrap;
  }
  .el-fx-card,
  .el-fx-result {
    flex: 1 1 calc(50% - 60px);
  }
}
@media (max-width: 720px) {
  .el-values {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 0;
  }
  .el-values li:nth-child(odd) {
    border-left: 0;
  }
  /* จอเล็ก: เรียงลงแนวตั้ง เครื่องหมายอยู่กลางระหว่างการ์ด */
  .el-fx-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .el-fx-card,
  .el-fx-result {
    flex: 1 1 auto;
  }
}
