: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; */
    color: var(--text-dark);
    background: #fff;
    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 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    max-width: 1240px;
    margin: 0 auto;
    gap: 20px;
}
.hn-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.hn-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
}
.hn-logo-text {
    line-height: 1.15;
}
.hn-logo-text .main {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--navy);
}
.hn-logo-text .sub {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 600;
}
.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);
}

/* ══════ 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;
    background-image: 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.3rem, 2.4vw, 1.7rem);
    font-weight: 700;
    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: 56px 0;
}
/* สลับสีพื้นหลังแต่ละ section ระหว่างขาว-ฟ้า: หมวดหมู่=ขาว, สินค้าแนะนำ=ฟ้า,
   ข่าวสาร=ขาว, สถิติ=ฟ้า (ไล่ต่อจาก hero ที่เป็นโทนฟ้าอยู่แล้ว) */
.hn-section--blue {
    background: #eef4fb;
}
/* ดันส่วน "เลือกช้อปตามหมวดหมู่" ให้ขึ้นไปทับ 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-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
}
.hn-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
}
.hn-section-title .bar {
    width: 5px;
    height: 24px;
    background: var(--gold);
    border-radius: 3px;
    display: inline-block;
}
.hn-section-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

/* ══════ CATEGORIES ══════ */
.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 160px;
    text-align: center;
}
.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: 12px;
}
.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;
}
.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-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;
}

/* ══════ 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);
}

/* ══════ หน้าตลาดแยกตามภาค (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;
}

/* ══════ RESPONSIVE ══════ */
@media (max-width: 992px) {
    .hn-nav-links {
        display: none;
    }
    .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) {
    .hn-cat-wrap,
    .hn-product-wrap {
        padding: 0 42px;
    }
    .hn-north-row {
        flex-wrap: wrap;
    }
    .hn-north-row .hn-product-card {
        flex: 1 1 calc(50% - 10px);
    }
    .hn-hero {
        min-height: 420px;
        background-position: center 30%;
    }
    .hn-section--overlap {
        margin-top: -20px;
    }
    .hn-hero-wave {
        height: 14%;
    }
    .hn-hero-fade {
        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;
        padding: 12px;
    }
    .hn-search-divider {
        display: none;
    }
    .hn-product-card {
        flex-basis: calc((100% - 20px) / 2);
    }
    .hn-stats-row {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 24px;
    }
    .hn-stat {
        border-right: none;
    }
    .hn-cat-card {
        flex: 0 0 130px;
    }
    .hn-cat-card .img-wrap {
        width: 130px;
        height: 130px;
    }
}
