:root {
    --navy: #142c56;
    --navy-dark: #0b1c38;
    --gold: #c9a227;
    --gold-light: #e2ba3a;
    --text-dark: #1c2b3a;
    --text-muted: #6b7684;
    --border-light: #e7e9ee;
    --radius-lg: 90px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

.hn * {
    box-sizing: border-box;
}

.hn {
    margin: 0;
    /* font-family: "Trirong", serif; */
    /* font-family: "Sarabun", sans-serif; */
     font-family: "Prompt", sans-serif;
    color: var(--text-dark);
    background: #0C447C;
     /* background: #eef4fb; */
    overflow-x: hidden;
}

.hn a {
    text-decoration: none;
    color: inherit;
}

.hn img {
    max-width: 100%;
    display: block;
}

.hn-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ══════ NAVBAR ══════
   .hn-navbar เป็นแถบเต็มความกว้างจอ (พื้นหลังขาว) จริงๆ ไม่ใช้มุกยิง ::before/box-shadow ล้นขอบ
   (เคยลองแบบนั้นแล้วพัง — element ที่ยิงกว้างเกิน 100vw/100vmax ทำให้มือถือคำนวณ layout viewport
   ผิดพลาด ซูมออกทั้งหน้าโดยไม่ตั้งใจ) ส่วน .hn-navbar-inner ค่อยจำกัด max-width:1240px กึ่งกลางจอแทน */
.hn-navbar {
    background: #fff;
}
.hn-navbar-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 24px;
    max-width: 1240px;
    margin: 0 auto;
    gap: 20px;
}
.hn-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.hn-logo-img {
    height: 92px;
    width: auto;
}
.hn-nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.hn-nav-links a {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.hn-nav-links a.active {
    color: var(--navy);
    font-weight: 700;
    border-bottom-color: var(--navy);
}
.hn-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.hn-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    background: #fff;
}
.hn-login-btn {
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 22px;
    border-radius: 30px;
    white-space: nowrap;
}
.hn-nav-toggle {
    display: none;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--navy);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

/* ══════ HERO ══════
   ใช้ hero-illustration.png เป็นพื้นหลังของ hero โดยตรง (background-image)
   แทนที่จะวางเป็น <img> แยกกล่อง แล้วปรับขนาด/ตำแหน่งให้ฉากตลาดอยู่ฝั่งขวา
   ส่วนฝั่งซ้าย (โซนข้อความ) มี fade ช่วยให้อ่านง่าย */
.hn-hero-wrap {
    background: linear-gradient(180deg, #dce8f7 0%, #eef4fb 55%, #ffffff 100%);
}
.hn-hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: flex-start;
    overflow: hidden;
    /* --hero-bg-desktop/--hero-bg-mobile ตั้งค่าจาก inline style ของแต่ละหน้า (ภาพจากหลังบ้าน)
       ถ้าไม่ได้ตั้ง จะ fallback ไปที่ภาพ default นี้ */
    background-image: var(--hero-bg-desktop, url("../img/hero-illustration.png"));
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
}
.hn-hero-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    width: 100%;
    height: 10%;
    z-index: 1;
    pointer-events: none;
}
.hn-hero-fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        100deg,
        rgba(238, 244, 251, 0.97) 0%,
        rgba(238, 244, 251, 0.9) 28%,
        rgba(238, 244, 251, 0.55) 46%,
        rgba(238, 244, 251, 0.1) 64%,
        rgba(238, 244, 251, 0) 76%
    );
}
.hn-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 5% 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.hn-hero-content {
    max-width: 560px;
}
.hn-hero-title {
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--navy);
    line-height: 1.15;
    margin-bottom: 4px;
}
.hn-hero-tagline {
    font-size: clamp(1.1rem, 2.0vw, 1.5rem);
    font-weight: 500;
    color: var(--navy);
    /* margin-bottom: 5px; */
}
.hn-hero-taglineA {
    font-size: clamp(0.5rem, 1.0vw, 1.0rem);
    font-weight: 500;
    color: var(--navy);
    /* margin-left: 10px; */
}
.hn-hero-taglineB {
    font-size: clamp(1.1rem, 2.0vw, 1.5rem);
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 16px;
}
.hn-hero-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}
.hn-search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(20, 44, 86, 0.16);
    padding: 6px 6px 6px 20px;
    gap: 10px;
    margin-bottom: 22px;
}
.hn-search-bar i {
    color: var(--text-muted);
}
.hn-search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.88rem;
    font-family: inherit;
    min-width: 0;
}
.hn-search-divider {
    width: 1px;
    height: 22px;
    background: var(--border-light);
}
.hn-search-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-dark);
    white-space: nowrap;
    padding-right: 6px;
}
.hn-search-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hn-hero-features {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.hn-hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hn-hero-feature .title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}
.hn-hero-feature .sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.hn-hero-feature .icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(20, 44, 86, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}

/* ══════ SECTION HEADING ══════ */
.hn-section {
    padding: 20px 0;
}
/* สลับสีพื้นหลังแต่ละ section ระหว่างขาว-ฟ้า: หมวดหมู่=ขาว, สินค้าแนะนำ=ฟ้า,
   ข่าวสาร=ขาว, สถิติ=ฟ้า (ไล่ต่อจาก hero ที่เป็นโทนฟ้าอยู่แล้ว) */
.hn-section--blue {
    background: #378ADD;
}
/* ดันส่วน "เลือกช้อปตามหมวดหมู่" ให้ขึ้นไปทับ hn-hero-wrap จากด้านล่างประมาณ 2%
   โดยอยู่ชั้นบนสุด (z-index สูงกว่า) — ใช้ class ตรงๆ แทน adjacent-sibling selector
   เพราะตอนนี้มี section ผลการค้นหา (ซ่อนไว้) แทรกอยู่ระหว่าง hero กับ section นี้ */
.hn-section--overlap {
    position: relative;
    z-index: 2;
    background: #fff;
    margin-top: -10vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.hn-section--overlapA {
    position: relative;
    z-index: 2;
    background:  #0C447C;
    margin-top: -10vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.hn-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
}
.hn-section-headA {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
    gap: 16px;
}
.hn-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    /* color: var(--navy); */
    color: #fff;
}
.hn-section-titleA {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    /* color: #fff; */
}
/* .hn-section-title-wrap: ครอบ bar + .hn-section-title ไว้ด้วยกัน เป็น flex item เดียวของ
   .hn-section-head (ใช้เฉพาะ section "ตลาดแนะนำ [ภาค]" ที่แยกคำนำหน้า/ชื่อภาคเป็นคนละบรรทัดบนมือถือ
   ต้องมี wrapper นี้ไม่งั้น .hn-section-head จะเห็น bar เป็น flex item แยกจาก title แล้ว
   justify-content:space-between จะดันห่างจากกันผิดที่บน desktop) */
.hn-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hn-section-title .bar,
.hn-section-title-wrap .bar {
    width: 5px;
    height: 24px;
    background: var(--gold);
    border-radius: 3px;
    display: inline-block;
}
.hn-section-titleA .bar {
    width: 5px;
    height: 24px;
    background: var(--gold);
    border-radius: 3px;
    display: inline-block;
}
a.hn-section-link {
    font-size: 0.88rem;
    font-weight: 600;
    /* color: var(--navy); */
    color: #fff;
    white-space: nowrap;
}

/* ══════ CATEGORIES ══════ */
  /* .hn-product-wrap {
        padding: 0 1px;
    }
    .hn-cat-wrap {
        padding: 0 1px;
    }
    .hn-cat-row {
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 3px;
        padding: 1px;
    } */
.hn-cat-wrap {
    position: relative;
    padding: 0 54px;
}
.hn-cat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.hn-cat-row::-webkit-scrollbar {
    display: none;
}
.hn-cat-card {
    flex: 0 0 96px;
    text-align: center;
}
.hn-cat-card .img-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 10px;
    /* background: #fff; */
    border: none;
    /* box-shadow: 0 6px 18px rgba(20, 44, 86, 0.1); */

       /* width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border: none; */
}
.hn-cat-card .img-wrap img {
    /* width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px; */
     width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}
.hn-cat-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.hn-cat-card .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.35;
    white-space: nowrap;
}
.hn-scroll-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border-light);
    box-shadow: 0 6px 16px rgba(20, 44, 86, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    cursor: pointer;
    z-index: 3;
}
.hn-scroll-btn--left {
    right: auto;
    left: 0;
}

/* ══════ PRODUCTS (เลื่อนซ้าย-ขวา แสดงทีละ 4 ตลาด เหมือนแถวหมวดหมู่) ══════ */
.hn-product-wrap {
    position: relative;
    padding: 0 54px;
}
.hn-product-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.hn-product-row::-webkit-scrollbar {
    display: none;
}
.hn-product-card {
    flex: 0 0 calc((100% - 3 * 20px) / 4);
    min-width: 0;
    scroll-snap-align: start;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(20, 44, 86, 0.1);
    border: 1px solid var(--border-light);
}
.hn-video-card {
    overflow: hidden;
}
.hn-video-card video {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    background: #000;
}
.hn-product-img {
    position: relative;
    aspect-ratio: 2 / 1;
}
.hn-product-img-inner {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
}
.hn-product-img-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hn-product-fav {
    position: absolute;
    bottom: -15px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(20, 44, 86, 0.18);
    overflow: hidden;
}
.hn-product-fav img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
/* แบบมีข้อความประเภทตลาดต่อจากไอคอน (ใช้ในการ์ดแถวตลาดแนะนำแต่ละภาค เหมือนหน้า index) */
.hn-product-fav--labeled {
    width: auto;
    max-width: none;
    border-radius: 20px;
    padding: 0 12px 0 4px;
    gap: 6px;
}
.hn-product-fav--labeled img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    padding: 2px;
}
.hn-product-fav-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}
.hn-product-body {
    padding: 20px 14px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}
.hn-product-body .price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hn-product-cart-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}
.hn-product-body .name {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 4px;
}
.hn-product-body .loc {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}
.hn-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.hn-product-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--navy);
    background: #eef4fb;
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
}
.hn-product-body .price {
    font-weight: 800;
    color: var(--gold);
    font-size: 1rem;
}
.hn-slide-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}
.hn-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-light);
    cursor: pointer;
    transition:
        width 0.25s,
        background 0.25s;
}
.hn-dot.active {
    width: 22px;
    border-radius: 4px;
    background: var(--navy);
}

/* ══════ ตลาดแนะนำ ภาคเหนือ (สแตติก ไม่เลื่อน: แถวแรก 2 ใบ, แถวสอง 3 ใบ) ══════ */
.hn-north-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hn-north-row {
    display: flex;
    gap: 20px;
}
.hn-north-row .hn-product-card {
    flex: 1 1 0;
    min-width: 0;
}

/* ══════ ตลาดแนะนำแยกตามภาค (หน้าแรก) — การ์ดเดียวกัน list เดียว ใช้ flex-wrap ล้วน
   ไม่แยก div แถวเหมือน .hn-north-grid/.hn-north-row (ตัวนั้นใช้ร่วมกับหน้า region-show
   ที่ต้องการ 2+3+3 แถว เลยแยก class ใหม่ไม่ให้ชนกัน) ══════ */
.hn-region-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.hn-region-grid .hn-product-card {
    min-width: 0;
    flex: 0 0 calc((100% - 20px) / 2);
}
.hn-region-grid .hn-product-card:nth-child(n + 3) {
    flex: 0 0 calc((100% - 2 * 20px) / 3);
}

/* desktop โชว์ "ตลาดแนะนำ ภาคกลาง/ภาคใต้" แบบเดิม (กริด 2+3), มือถือโชว์ "(1)" แทน */
#hnRegionCentralMobile,
#hnRegionSouthMobile {
    display: none;
}
@media (max-width: 640px) {
    #hnRegionCentralDesktop,
    #hnRegionSouthDesktop {
        display: none;
    }
    #hnRegionCentralMobile,
    #hnRegionSouthMobile {
        display: block;
    }
}

/* ══════ ตลาดแนะนำภาคกลาง(1): แถวแรก 1 ตลาด (การ์ดเดิม) + แถวถัดไปแบบรายการแนวนอน ══════ */
.hn-central-featured {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.hn-central-featured .hn-product-card {
    width: 100%;
    max-width: 320px;
}
.hn-central-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.hn-market-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(20, 44, 86, 0.1);
    border: 1px solid var(--border-light);
    padding: 0px;
}
.hn-market-list-img {
    position: relative;
    flex: 0 0 250px;
    aspect-ratio: 2 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.hn-market-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hn-market-list-body {
    flex: 1;
    min-width: 0;
}
.hn-market-list-body .name {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.hn-market-list-body .loc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
/* ป้ายประเภทตลาด: วางทับมุมล่างซ้ายของรูป (แทนที่จะอยู่ในส่วนรายละเอียด) */
.hn-market-list-cat {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.92);
    padding: 3px 10px 3px 3px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(20, 44, 86, 0.18);
}
.hn-market-list-cat img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
}

/* ══════ NEWS + MAP ══════ */
.hn-news-map-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: stretch;
}
.hn-news-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(20, 44, 86, 0.12);
    border: 1px solid var(--border-light);
}
.hn-news-card .hn-news-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.hn-news-card-body {
    padding: 22px 24px 10px;
}
.hn-news-list {
    padding: 6px 24px 20px;
}
.hn-news-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}
.hn-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.hn-news-date {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}
.hn-news-date .day {
    font-size: 1.1rem;
    font-weight: 800;
}
.hn-news-date .month {
    font-size: 0.62rem;
    opacity: 0.85;
}
.hn-news-item .title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 3px;
}
.hn-news-item .loc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hn-map-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(150deg, #dbe7f8 0%, #eaf1fb 100%);
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    padding: 32px 28px;
}
.hn-map-card-img {
    position: absolute;
    inset: 15px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
}
.hn-map-card-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
.hn-map-card-text h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.25;
    margin-bottom: 10px;
}
.hn-map-card-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.hn-btn-gold-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold);
    color: #2a2205;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 30px;
    align-self: flex-start;
}

/* ══════ STATS ══════ */
.hn-stats {
    background: #eef4fb;
    border-top: 1px solid var(--border-light);
    padding: 40px 0;
}
.hn-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.hn-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 24px;
    border-right: 1px solid var(--border-light);
}
.hn-stat:last-child {
    border-right: none;
}
.hn-stat .icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}
.hn-stat .num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}
.hn-stat .label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ══════ ผลการค้นหา (หน้าแรก) — แสดงเป็น popup ลอยทับหน้า แทน section แทรกเนื้อหา ══════ */
.hn-search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 20px;
    overflow-y: auto;
}
.hn-search-modal.open {
    display: flex;
}
.hn-search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 26, 48, 0.6);
    backdrop-filter: blur(2px);
}
.hn-search-modal-panel {
    position: relative;
    z-index: 1;
    background: var(--navy);
    border-radius: var(--radius-md);
    max-width: 1100px;
    width: 100%;
    /* min-width:0 กัน flex item (ตัวนี้เป็นลูกของ .hn-search-modal ที่ display:flex) ขยายกว้างเกิน
       width:100% ตาม min-content ของการ์ดผลค้นหาข้างใน (ค่า default ของ flex item คือ min-width:auto
       ซึ่งปล่อยให้เนื้อหากว้างเกิน container ได้) — ถ้าไม่กันไว้ ตัว panel นี้ (position:fixed ผ่าน
       .hn-search-modal ที่เป็น parent) จะกว้างเกิน viewport มือถือ ทำให้ปุ่ม "ล้างการค้นหา" ตกขอบจอไป
       เพราะ overflow-x:hidden ของ body ไม่ครอบคลุมถึง fixed element */
    min-width: 0;
    overflow-x: hidden;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
/* พื้นหลัง popup เป็นสีขาวเสมอ (ไม่ได้ตามธีมพื้นหลังสลับขาว-ฟ้าเข้มของหน้า) เลยต้องบังคับสีตัวหนังสือ
   ให้เข้มอ่านออกเอง แทนสีขาวที่ .hn-section-title/.hn-section-link ใช้เป็นค่าเริ่มต้นทั้งหน้า */
.hn-search-modal-panel .hn-section-title {
    color: #fff;
}
.hn-search-modal-panel a.hn-section-link {
    color: #fff;
}
@media (max-width: 640px) {
    .hn-search-modal {
        padding: 0;
    }
    .hn-search-modal-panel {
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        padding: 20px;
    }
    /* มือถือ: แยก "ล้างการค้นหา" ออกมาอยู่บรรทัดบนสุด ชิดขวา แล้ว "ผลการค้นหา ..." ลงมาอีกบรรทัด
       (เดิมอยู่แถวเดียวกัน ชิดซ้าย-ขวา ทำให้แน่นเกินไปตอนข้อความหัวข้อยาว) ใช้ order สลับตำแหน่ง
       โดยไม่ต้องแก้ลำดับ HTML (a.hn-section-link มาทีหลัง .hn-section-title ใน markup) */
    .hn-search-modal-panel .hn-section-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .hn-search-modal-panel .hn-section-title {
        order: 2;
    }
    .hn-search-modal-panel a.hn-section-link {
        order: 1;
        align-self: flex-end;
    }
    /* หัวข้อ "ผลการค้นหา"/"ตลาดประเภท" บนมือถือ: บังคับให้ "(N ตลาด)" ขึ้นบรรทัดใหม่เสมอด้วย \n
       ที่ฝังไว้ตอนสร้างข้อความ (ดู runSearch()/filterByCategory() ใน blade) แทนที่จะปล่อยให้ตัดคำ
       ล้นกลางประโยคแบบสุ่มตอนข้อความยาวเกินความกว้างจอ */
    #hnSearchTitle {
        white-space: pre-line;
    }
}

/* ══════ หน้าตลาดแยกตามภาค (region-show.blade.php) ══════ */
.hn-market-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.hn-market-page {
    display: none;
}
.hn-market-page.active {
    display: block;
}
.hn-search-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.hn-search-grid .hn-product-card {
    flex: 0 0 calc((100% - 3 * 20px) / 4);
}
.hn-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.hn-page-link {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.hn-page-link:hover {
    border-color: var(--navy);
    color: var(--navy);
}
.hn-page-link.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.hn-page-link.disabled {
    pointer-events: none;
    opacity: 0.4;
}

/* ══════ FOOTER ══════ */
.hn-footer {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.85);
    padding: 48px 0 20px;
}
.hn-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 28px;
}
.hn-footer-logo-plate {
    display: inline-block;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 12px;
}
.hn-footer-logo-img {
    height: 56px;
    width: auto;
}
.hn-footer-desc {
    font-size: 0.85rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}
.hn-footer-col h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.hn-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hn-footer-col ul a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}
.hn-footer-col ul a:hover {
    color: var(--gold);
}
.hn-footer-social {
    display: flex;
    gap: 14px;
    font-size: 1.3rem;
}
.hn-footer-social a {
    color: rgba(255, 255, 255, 0.85);
}
.hn-footer-social a:hover {
    color: var(--gold);
}
.hn-footer-hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 0 0 16px;
}
.hn-footer-copy {
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ══════ เมนูด่วนภาค (มือถือเท่านั้น — ดูเงื่อนไข display ใน RESPONSIVE ด้านล่าง) ══════ */
.hn-quicknav {
    display: none;
    background: #fff;
}
.hn-quicknav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.hn-quicknav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.hn-quicknav-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f7f0e6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(20, 44, 86, 0.1);
    flex-shrink: 0;
}
.hn-quicknav-icon svg {
    width: 30px;
    height: 30px;
}
.hn-quicknav-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
}

/* ══════ RESPONSIVE ══════ */
@media (max-width: 992px) {
    .hn-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        padding: 8px 24px 16px;
        box-shadow: 0 10px 24px rgba(20, 44, 86, 0.15);
        z-index: 50;
    }
    .hn-nav-links.hn-nav-links--open {
        display: flex;
    }
    .hn-nav-links li {
        width: 100%;
    }
    .hn-nav-links a {
        display: block;
        padding: 14px 4px;
        border-bottom: 1px solid var(--border-light);
        white-space: normal;
    }
    .hn-nav-toggle {
        display: block;
    }
    .hn-product-card {
        flex-basis: calc((100% - 2 * 20px) / 3);
    }
    .hn-news-map-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    /* มือถือ: หัวข้อ "ตลาดแนะนำ [ภาค]" จัดเป็นตาราง 2 แถว x 3 คอลัมน์ (bar | ข้อความ | ดูทั้งหมด)
         แถว 1: ตลาดแนะนำ (เล็ก)
         แถว 2: ชื่อภาค (ใหญ่เท่าเดิม)      ดูทั้งหมด
       bar คร่อมทั้ง 2 แถว ใช้ display:contents "แผ่แบน" .hn-section-title-wrap/.hn-section-title
       ให้ลูกๆ (bar, prefix, region) กลายเป็น grid item ตรงของ .hn-section-head--split เอง
       จะได้จัดตำแหน่งทีละตัวด้วย grid-row/grid-column ได้ตรงๆ — scope ด้วย .hn-section-head--split
       (คลาสเสริมเฉพาะ section นี้) ไม่กระทบ .hn-section-head ของ section อื่นที่ไม่มีคลาสนี้ */
    .hn-section-head--split {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 2px;
    }
    .hn-section-head--split .hn-section-title-wrap,
    .hn-section-head--split .hn-section-title {
        display: contents;
    }
    .hn-section-head--split .bar {
        grid-row: 1 / 3;
        grid-column: 1;
        width: 5px;
        height: 100%;
        align-self: stretch;
    }
    .hn-section-head--split .hn-section-title-prefix {
        grid-row: 1;
        grid-column: 2;
        font-size: 0.85rem;
    }
    .hn-section-head--split .hn-section-title-region {
        grid-row: 2;
        grid-column: 2;
        font-size: 1.4rem;
    }
    .hn-section-head--split a.hn-section-link {
        grid-row: 2;
        grid-column: 3;
        justify-self: end;
    }
    .hn-market-list-img {
        flex: 0 0 200px;
    }
    .hn-market-list-body .name {
        font-size: 0.82rem;
        line-height: 1.3;
    }
    .hn-market-list-body .loc {
        font-size: 0.7rem;
    }
    .hn-market-list-cat {
        font-size: 0.68rem;
    }
    .hn-hero-features{
        display: none;
    }
    .hn-hero-tagline{
        display: none;
    }
     .hn-hero-taglineA{
        display: none;
    }
     .hn-hero-taglineB{
        display: none;
    }
     .hn-hero-desc{
        display: none;
    }
     .hn-hero-title{
        display: none;
        /* font-size: 30px;
        text-align: center;
         margin-top:10% ;
        margin-bottom:6% ; */
    }
    .hn-hero-inner {
        justify-content: center;
    }
    .hn-hero-content {
        max-width: 100%;
    }
   .hn-product-tags{
        display: none;
    }
    
    

    /* เมนูด่วนภาคแสดงเฉพาะมือถือ กลายเป็น section แรกที่ต่อจาก hero แทนที่ผลการค้นหา/หมวดหมู่
       เลยต้องเอา class hn-section--overlap (ดันขึ้นทับขอบล่าง hero) มาไว้ที่นี่แทน ไม่งั้นจะดันซ้อนกัน 2 ที่ */
    .hn-quicknav {
        display: block;
        position: relative;
        z-index: 2;
        margin-top: -40px;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        padding: 24px 0 8px;
    }
    #hnSearchSection.hn-section--overlap,
    #hnCategorySection.hn-section--overlap {
        margin-top: 0;
        border-radius: 0;
    }
    .hn-product-wrap {
        padding: 0 1px;
    }
    .hn-cat-wrap {
        padding: 0 1px;
    }
    .hn-cat-row {
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 3px;
        padding: 1px;
    }
    /* .hn-north-grid/.hn-north-row ใช้ร่วมกับ region-show.blade.php (ลิสต์ตลาดแบบ 2+3+3)
       คงพฤติกรรมเดิมไว้ ไม่ยุ่งกับ 2 คลาสนี้อีก */
    .hn-north-grid {
        gap: 5px;
    }
    .hn-north-row {
        flex-wrap: wrap;
        gap: 5px;
    }
    .hn-north-row .hn-product-card {
        flex: 1 1 calc(50% - 10px);
    }
.hn-container {

    padding: 0 10px;
}
    /* ตลาดแนะนำแยกตามภาค (หน้าแรก): ตลาดแรกเต็มแถว ที่เหลือ 2 ต่อแถว
       ต้อง override nth-child(n+3) ของ desktop (33%) ด้วย ไม่งั้นจะชนะที่มือถือ */
    .hn-region-grid .hn-product-card {
        flex: 1 1 calc(50% - 10px);
    }
    .hn-region-grid .hn-product-card:nth-child(n + 3) {
        flex: 1 1 calc(50% - 10px);
    }
    .hn-region-grid .hn-product-card:first-child {
        flex: 1 1 100%;
    }
    .hn-hero {
        min-height: 300px;
        background-image: var(--hero-bg-mobile, url("../img/hero-illustration-1.png"));
        background-position: center 30%;
    }
    .hn-section--overlap {
        margin-top: -20px;
    }
    .hn-hero-wave {
        height: 14%;
    }
    .hn-hero-fade {
         display: none;
        /* background: linear-gradient(
            180deg,
            rgba(238, 244, 251, 0.97) 0%,
            rgba(238, 244, 251, 0.9) 30%,
            rgba(238, 244, 251, 0.35) 46%,
            rgba(238, 244, 251, 0) 58%
        ); */
    }
    .hn-search-bar {
        flex-wrap: wrap;
        border-radius: 20px;
         margin-top:45% ;
        
    }
    .hn-search-divider {
        display: none;
    }
    .hn-product-card {
        flex-basis: calc((100% - 20px) / 2);
    }
    /* วิดีโอแนะนำ บนมือถือ: ย่อการ์ดให้เห็นหลายอันต่อหน้าจอ (มีขอบการ์ดถัดไปโผล่ให้เห็นเล็กน้อย)
       ใช้ id คุมสเปซิฟิซิตี้ ให้ชนะ .hn-product-card เดิม/ที่ซ้ำกันในไฟล์นี้แน่นอน ไม่ว่าจะมาก่อนหรือหลัง */
    #hnProductRow .hn-video-card {
        flex: 0 0 28%;
        min-width: 0;
    }
    .hn-stats-row {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 24px;
    }
    .hn-stat {
        border-right: none;
    }
    .hn-cat-card {
        flex: 0 0 calc((100% - 2 * 14px) / 5);
    }
    .hn-cat-card .img-wrap {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border: none;
    }
    /* .hn-cat-card .img-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 10px;
    background: #fff;
    border: 3px solid #4a8fd6;
    box-shadow: 0 6px 18px rgba(20, 44, 86, 0.1);
} */
.hn-cat-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}
    .hn-cat-card .label {
        font-size: 0.7rem;
        white-space: normal;
    }
    .hn-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hn-footer {
        /* padding: auto 2%; */
         padding: 48px 20px 20px;
        /* display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center; */
    }

    /* ══════ ตลาดแนะนำภาคกลาง(1): แถวแรก 1 ตลาด (การ์ดเดิม) + แถวถัดไปแบบรายการแนวนอน ══════ */
.hn-central-featured {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}
.hn-central-featured .hn-product-card {
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
}
.hn-central-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.hn-market-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(20, 44, 86, 0.1);
    border: 1px solid var(--border-light);
    padding: 1px;
}
.hn-market-list-img {
    position: relative;
    flex: 0 0 200px;
    aspect-ratio: 2 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.hn-market-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hn-market-list-body {
    flex: 1;
    min-width: 0;
}
.hn-market-list-body .name {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.hn-market-list-body .loc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.hn-market-list-cat {
    position: absolute;
    left: 6px;
    bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.92);
    padding: 2px 8px 2px 2px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(20, 44, 86, 0.18);
}
.hn-market-list-cat img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
}
.hn-product-card {
    flex: 0 0 calc((100% - 3 * 20px) / 1);
    min-width: 0;
    scroll-snap-align: start;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(20, 44, 86, 0.1);
    border: 1px solid var(--border-light);
}
.hn-scroll-btn {
     display: none;
}
.hn-product-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    scrollbar-width: none;
}
.hn-search-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.hn-search-grid .hn-product-card {
    flex: 0 0 calc((100% - 1 * 20px) / 2);
}
}
