/* =========================================================
   home.css — สไตล์เฉพาะหน้าแรก
   ========================================================= */

/* ---------- Hero (รูปใหญ่ด้านบน) ---------- */
.hero {
  min-height: 213px;
  /* ภาพเคลื่อนไหว (แปลงจาก GIF เป็น WebP ไฟล์เล็กลงเกือบ 5 เท่า)
     + ชั้นสีดำบางๆ 30% ทับไว้ ให้ตัวหนังสือสีขาวอ่านง่าย */
  background-color: #9AA7AE;
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(../images/hero.webp);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 18px 16px;
}
.hero-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow:
    2px 0 0 #C5D5E8, -2px 0 0 #C5D5E8, 0 2px 0 #C5D5E8, 0 -2px 0 #C5D5E8,
    2px 2px 0 #C5D5E8, -2px -2px 0 #C5D5E8, 2px -2px 0 #C5D5E8, -2px 2px 0 #C5D5E8,
    0 4px 8px rgba(0, 0, 0, 0.18);
}
.hero-sub {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.hero-sub span { display: inline-block; }
.hero-actions { display: flex; justify-content: center; gap: 45px; margin-top: 14px; }
.btn-hero {
  min-width: 99px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  border-radius: 999px;
  background: var(--c-blue);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

/* ---------- ปุ่มติดต่อแอดมิน 2 ปุ่ม ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding-top: 23px;
}
.contact-btn {
  position: relative;
  aspect-ratio: 480 / 210;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url(../images/contact-bg.png) center / 100% 100% no-repeat;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  text-shadow: var(--stroke-blue);
}
.contact-btn span { position: relative; z-index: 1; margin-top: -2px; }
.contact[hidden] { display: none; }
/* เหลือปุ่มเดียว (อีกปุ่มเว้นว่างในหน้าตั้งค่าร้าน): อยู่กลาง ขนาดเท่าเดิม */
.contact.is-single { grid-template-columns: minmax(0, calc(50% - 18px)); justify-content: center; }
.wing { position: absolute; bottom: -17px; width: 52px; z-index: 2; pointer-events: none; }
.wing-left { left: -14px; }
.wing-right { right: -16px; bottom: -14px; }

.home-divider { margin: 26px 0 27px; }

/* ---------- การ์ดสถิติ 4 ใบ ---------- */
.stats { display: grid; gap: 17px; }
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 110px;
  padding: 6px 10px 8px;
  text-align: left;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
}
/* กดได้ทั้งการ์ด (เปิดป๊อปอัปสถิติแบบละเอียด) */
.stat-card { cursor: pointer; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(94, 150, 210, 0.2); }
.stat-card:active { transform: translateY(0); }
.stat-card:focus-visible { outline: 2px solid var(--c-blue-strong); outline-offset: 2px; }
.stat-body { flex: 1; min-width: 0; }
.stat-title,
.stat-value,
.stat-updated { display: block; }
.stat-title { font-size: 19px; font-weight: 400; color: var(--c-blue); line-height: 1.35; }
.stat-value { font-size: 30px; line-height: 1.15; color: var(--c-text); white-space: nowrap; }
.stat-value small { font-size: 15px; color: var(--c-gray); margin-left: 10px; }
.stat-change { font-size: 11px; color: var(--c-gray); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-change .up { color: var(--c-green); display: inline-flex; align-items: center; gap: 2px; font-weight: 500; }
.stat-change .up svg { width: 11px; height: 11px; }
.stat-change .flat { font-weight: 500; }
.stat-updated { font-size: 9px; color: var(--c-gray); margin-top: 3px; }
.stat-icon { width: 90px; display: flex; justify-content: center; margin-right: 12px; flex-shrink: 0; }
.stat-deco { position: absolute; right: -15px; bottom: -9px; width: 41px; pointer-events: none; }

/* ---------- กล่องข้อมูลร้าน ---------- */
.info-box {
  position: relative;
  margin: 20px auto 0;
  padding: 7px 16px 8px;
  background: #fff;
  border: 1px solid var(--c-blue-pale);
  border-radius: 20px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}
.info-box .dessert { position: absolute; left: -10px; bottom: -10px; width: 41px; }

/* ---------- การสั่งซื้อล่าสุด ---------- */
.activity {
  margin-top: 20px;
  padding: 10px 16px;
  background: var(--c-cream);
  border: 1px solid var(--c-blue);
  border-radius: 12px;
}
.activity h2 { font-size: 17px; font-weight: 600; color: var(--c-text); line-height: 1.4; }
.activity-sub {
  font-size: 10px;
  color: var(--c-blue-pale);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--c-blue);
}
.activity-list { display: grid; gap: 5px; margin-top: 12px; }
.activity-empty { grid-column: 1 / -1; padding: 14px; border: 1px dashed var(--c-blue-pale); border-radius: 12px; font-size: 14px; color: var(--c-blue); text-align: center; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid var(--c-blue);
  border-radius: 10px;
  font-size: 13px;
}
.activity-item img { width: 15px; flex-shrink: 0; }
.activity-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.activity-time { flex-shrink: 0; color: var(--c-blue); }

/* ---------- สินค้าแนะนำ ---------- */
.home-divider-lg { margin: 41px 0 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; font-weight: 500; color: var(--c-blue); }
.btn-small {
  height: 25px;
  line-height: 25px;
  padding: 0 11px;
  margin-right: -6px;
  border-radius: 999px;
  background: var(--c-blue);
  color: #fff;
  font-size: 12px;
}
.recommended { padding-bottom: 17px; }

/* ---------- จอใหญ่ขึ้น (แท็บเล็ต / คอม) ---------- */
@media (min-width: 640px) {
  .hero { min-height: 300px; }
  .hero-title { font-size: 46px; }
  .hero-sub { font-size: 15px; }
  .btn-hero { min-width: 130px; height: 44px; font-size: 15px; }
  .contact { max-width: 600px; margin: 0 auto; gap: 48px; padding-top: 32px; }
  .contact-btn { font-size: 22px; }
  .wing { width: 64px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 20px 28px; }
  .info-box { max-width: 600px; font-size: 15px; padding: 10px 24px; }
  .info-box .dessert { width: 52px; }
  .section-head h2 { font-size: 24px; }
  .btn-small { height: 30px; line-height: 30px; font-size: 13px; padding: 0 16px; margin-right: 0; }
}
@media (min-width: 1024px) {
  .hero { min-height: 360px; }
  .hero-title { font-size: 60px; }
  .hero-sub { font-size: 17px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat-icon { width: 70px; margin-right: 8px; }
  .stat-icon img { transform: scale(0.85); }
  .stat-change { font-size: 12px; }
  .stat-updated { font-size: 11px; }
  .activity { padding: 14px 20px; }
  .activity h2 { font-size: 20px; }
  .activity-sub { font-size: 12px; }
  .activity-list { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
}

/* คนที่ตั้งค่าเครื่องให้ลดการเคลื่อนไหว: ใช้ภาพนิ่ง (เฟรมแรก) แทน */
@media (prefers-reduced-motion: reduce) {
  .hero { background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(../images/hero-still.webp); }
}
