/* =========================================================
   หน้าแรก: section ของ Section Manager / Elementor widgets (README ข้อ 13.3, 20)
   ========================================================= */
.home-section { margin-block: clamp(48px, 7vw, 96px); }
.home > .hero + .home-section,
.home > .home-usp { margin-top: clamp(32px, 5vw, 56px); }
.section-head__link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--hh-text); text-decoration: none; white-space: nowrap; }
.section-head__link:hover { color: var(--hh-accent); }
.section-head--center { justify-content: center; text-align: center; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hh-surface); }
.hero__track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero__track::-webkit-scrollbar { display: none; }
.hero__slide { position: relative; scroll-snap-align: start; min-height: clamp(420px, 68vh, 760px); display: grid; align-items: center; }
.hero__media, .hero__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__img { object-fit: cover; }
.hero__content { position: relative; z-index: 1; display: flex; }
.hero__box { max-width: 560px; padding-block: 48px; }
.hero__slide--center .hero__content { justify-content: center; text-align: center; }
.hero__slide--right .hero__content { justify-content: flex-end; }
.hero__title { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.75rem); line-height: 1.15; }
.hero__subtitle { margin: 0 0 24px; font-size: var(--hh-fs-lg); color: var(--hh-text-muted); }
.hero__slide--light { color: #fff; }
.hero__slide--light .hero__subtitle, .hero__slide--light .eyebrow { color: rgb(255 255 255 / 0.85); }
.hero__slide--light::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 0.45), rgb(0 0 0 / 0.05) 70%); }
.hero__slide--light.hero__slide--right::after { background: linear-gradient(270deg, rgb(0 0 0 / 0.45), rgb(0 0 0 / 0.05) 70%); }
.hero__slide--light.hero__slide--center::after { background: rgb(0 0 0 / 0.3); }
.hero__nav { position: absolute; top: 50%; z-index: 2; translate: 0 -50%; background: var(--hh-bg); box-shadow: var(--hh-shadow-2); }
.hero__nav--prev { left: 16px; }
.hero__nav--next { right: 16px; }
.hero__dots { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.hero__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.6); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.15); cursor: pointer; transition: width var(--hh-dur) var(--hh-ease-out), background-color var(--hh-dur); }
.hero__dot.is-active { width: 28px; background: var(--hh-accent); }
@media (max-width: 767px) {
	.hero__nav { display: none; }
	.hero__slide { min-height: min(78svh, 620px); align-items: end; }
	.hero__box { padding-bottom: 56px; }
	.hero__slide--light::after { background: linear-gradient(0deg, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0) 70%); }
}

.hero--text { padding-block: clamp(56px, 10vw, 120px); background: linear-gradient(135deg, var(--hh-accent-soft), var(--hh-surface) 60%); }
.hero--text .hero__inner { max-width: 820px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- หมวดหมู่ ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 768px) { .cat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cat-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cat-tile { display: grid; gap: 6px; text-decoration: none; color: var(--hh-text); }
.cat-tile__media { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--hh-radius-lg); background: var(--hh-card-media); overflow: hidden; }
.cat-tile__media img { width: 100%; height: 100%; object-fit: contain; transition: transform var(--hh-dur-slow) var(--hh-ease-out); }
.cat-tile:hover .cat-tile__media img { transform: scale(1.05); }
.cat-tile__placeholder { color: var(--hh-text-muted); }
.cat-tile__name { font-weight: 600; line-height: 1.4; }
.cat-tile__count { font-size: var(--hh-fs-xs); color: var(--hh-text-muted); }

/* ---------- จุดเด่น ---------- */
.home-usp { padding-block: 28px; border-block: 1px solid var(--hh-border); }
.usp-grid { margin: 0; padding: 0; list-style: none; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.usp { display: flex; gap: 14px; align-items: flex-start; }
.usp__icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; background: var(--hh-accent-soft); color: var(--hh-accent); }
.usp__body { display: grid; gap: 2px; }
.usp__title { font-size: var(--hh-fs-base); }
.usp__text { font-size: var(--hh-fs-sm); color: var(--hh-text-muted); }

/* ---------- Mix CTA ---------- */
.mix-cta { display: grid; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 48px); border-radius: var(--hh-radius-lg); background: var(--hh-surface); }
@media (min-width: 900px) { .mix-cta { grid-template-columns: 1.1fr 1fr; } }
.mix-cta__lead { color: var(--hh-text-muted); margin: 0 0 20px; }
.mix-cta__visual { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.mix-cta__part { display: block; aspect-ratio: 1; border-radius: var(--hh-radius-lg); background: var(--hh-bg); overflow: hidden; }
.mix-cta__part img { width: 100%; height: 100%; object-fit: contain; }
.mix-cta__plus { font-size: 2.5rem; font-weight: 300; color: var(--hh-accent); }

/* ---------- วิดีโอ ---------- */
.home-videos { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .home-videos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.home-video { display: grid; gap: 8px; text-decoration: none; color: var(--hh-text); }
.home-video__media { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--hh-radius-lg); background: #111; overflow: hidden; }
.home-video__media img { width: 100%; height: 100%; object-fit: cover; }
.home-video:hover .gallery__play { transform: translate(-50%, -50%) scale(1.08); background: var(--hh-accent); }
.home-video__title { font-weight: 600; font-size: var(--hh-fs-sm); line-height: 1.4; }

/* ---------- แบนเนอร์ ---------- */
.home-banner { position: relative; display: grid; align-items: center; min-height: 260px; padding: clamp(24px, 5vw, 56px); border-radius: var(--hh-radius-lg); background: var(--hh-accent-soft); overflow: hidden; }
.home-banner--image { color: #fff; }
.home-banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-banner--image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0)); }
.home-banner__content { position: relative; z-index: 1; max-width: 520px; display: grid; gap: 12px; justify-items: start; }
.home-banner__title { margin: 0; font-size: var(--hh-fs-2xl); }
.home-banner__text { margin: 0; }

/* ---------- เรื่องราวแบรนด์ ---------- */
.home-brand { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .home-brand--video { grid-template-columns: 1fr 1.2fr; } }
.home-brand__body { color: var(--hh-text-muted); }
.home-brand__video .gallery__track { display: block; overflow: hidden; border-radius: var(--hh-radius-lg); }
.home-brand__video .gallery__slide { margin: 0; aspect-ratio: 16 / 9; position: relative; background: #000; }
.home-brand__video .gallery__video { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.home-brand__video .gallery__video img { width: 100%; height: 100%; object-fit: cover; }
.home-brand__video .gallery__player { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- คำถามที่พบบ่อย ---------- */
.faq { display: grid; gap: 10px; }
.faq__item { border: 1px solid var(--hh-border); border-radius: var(--hh-radius); background: var(--hh-bg); }
.faq__q { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; font-weight: 600; }
.faq__q::-webkit-details-marker { display: none; }
.faq__item[open] .faq__q .hh-icon { transform: rotate(180deg); }
.faq__a { padding: 0 18px 16px; color: var(--hh-text-muted); }

/* ---------- ติดต่อ ---------- */
.home-contact { display: grid; gap: 24px; padding: clamp(24px, 4vw, 40px); border-radius: var(--hh-radius-lg); background: var(--hh-surface); }
@media (min-width: 900px) { .home-contact { grid-template-columns: 1.3fr 1fr; align-items: stretch; } }
.home-contact__row { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; color: var(--hh-text-muted); }
.home-contact__row .hh-icon { flex: none; margin-top: 3px; }
.home-contact__buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.home-map { display: grid; place-content: center; justify-items: center; gap: 8px; height: 100%; min-height: 200px; border-radius: var(--hh-radius-lg); background: var(--hh-bg); color: var(--hh-accent); text-decoration: none; font-weight: 600; border: 1px dashed var(--hh-border); }

@media (prefers-reduced-motion: reduce) {
	.cat-tile__media img, .hero__dot { transition: none; }
}

/* มือถือ: หมวดหมู่และวิดีโอเป็นแถวปัดซ้ายขวา ไม่กินความสูงหน้าจอ */
@media (max-width: 767px) {
	.cat-tiles,
	.home-videos {
		grid-template-columns: none;
		grid-auto-flow: column;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		margin-inline: calc(var(--hh-gutter) * -1);
		padding-inline: var(--hh-gutter);
		scroll-padding-inline: var(--hh-gutter);
	}
	.cat-tiles::-webkit-scrollbar,
	.home-videos::-webkit-scrollbar { display: none; }
	.cat-tiles { grid-auto-columns: 34%; }
	.home-videos { grid-auto-columns: 46%; }
	.cat-tile, .home-video { scroll-snap-align: start; }
}

/* ---------- ใช้ใน Elementor widget ---------- */
.home-block + .home-block { margin-top: 32px; }
.home-block.container--narrow { max-width: var(--hh-container-narrow); margin-inline: auto; }
/* Elementor ตั้ง .elementor img { height: auto } ซึ่งชนะ class เดียวของธีม รูปที่ต้องเต็มกรอบจึงต้องยืนยันซ้ำ */
.elementor :is(.hero__img, .pcard__img, .card__img, .home-banner__img, .cat-tile__media img, .mix-cta__part img, .home-video__media img, .gallery__zoom img, .gallery__video img, .gallery__thumb img, .mix-item__media img, .vcard__facade img, .vprod__media img, .list-item__thumb img) { height: 100%; }
.elementor .subcats__img { height: 36px; border-radius: 999px; }
@media (min-width: 1024px) { .product-grid--fixed { grid-template-columns: repeat(var(--hh-cols, 4), minmax(0, 1fr)); } }
.search-box { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 18px; border: 1px solid var(--hh-border); border-radius: 999px; background: var(--hh-surface); color: var(--hh-text-muted); font: inherit; text-align: left; cursor: text; }
.search-box:hover { border-color: var(--hh-accent); }
.search-box kbd { margin-left: auto; padding: 2px 8px; border: 1px solid var(--hh-border); border-radius: var(--hh-radius-sm); font-size: var(--hh-fs-xs); }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-buttons--icons .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.contact-buttons--icons .btn { width: 48px; padding: 0; }
.list-button { position: relative; }
.list-button .list-badge { top: -6px; right: -6px; }
