/* ==========================================================================
   Haylink Core: header, footer, หน้าแรก และการ์ดสินค้า
   ใช้สีและป้ายราคาสีเหลืองชุดเดียวกับหน้าสินค้า
   ========================================================================== */
:root {
  --hl-ink: #22303c;
  --hl-muted: #5e6b78;
  --hl-line: #dce3e8;
  --hl-panel: #f2f5f7;
  --hl-tag: #ffe15a;
  --hl-cta: #ee4d2d;
  --hl-link: #0b6e69;
  --hl-radius: 12px;
}

.hl-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hl-wrap {
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}
.hl-header a:focus-visible,
.hl-footer a:focus-visible,
.hl-sec a:focus-visible,
.hl-home-hero a:focus-visible,
.hl-allcats > summary:focus-visible {
  outline: 3px solid var(--hl-link);
  outline-offset: 2px;
}

/* ให้ header/footer เต็มความกว้าง เมื่ออยู่ในคอนเทนเนอร์ของ Elementor */
.elementor-location-header .e-con:has(.hl-header),
.elementor-location-footer .e-con:has(.hl-footer) {
  --padding-top: 0px;
  --padding-right: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
  --content-width: 100%;
  --gap: 0px;
  padding: 0 !important;
}
.elementor-location-header .e-con:has(.hl-header) > .e-con-inner,
.elementor-location-footer .e-con:has(.hl-footer) > .e-con-inner {
  max-width: none;
  padding: 0;
}

/* ---------- ป้ายราคา (ใช้ร่วมกันใน logo, การ์ดดีล) ---------- */
.hl-logo-tag,
.hl-deal-tag {
  background:
    radial-gradient(circle at 12px 50%, #fff 0 3.5px, var(--hl-ink) 3.5px 4.5px, transparent 5px),
    var(--hl-tag);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
}

/* ---------- Header ---------- */
.hl-header {
  background: #fff;
  color: var(--hl-ink);
  font-size: 16px;
  line-height: 1.5;
}
.hl-header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 74px;
}
.hl-logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--hl-ink);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.hl-logo:hover { color: var(--hl-ink); }
.hl-logo-tag {
  padding: 3px 12px 3px 21px;
  transform: rotate(-3deg);
}
.hl-logo-rest { padding-left: 2px; }
.hl-logo .hl-logo-tag { color: var(--hl-ink); }
/* หน้าแรกมีช่องค้นหาใหญ่ใน hero แล้ว จึงซ่อนช่องค้นหาใน header */
.home .hl-search--header { display: none; }
.hl-header .custom-logo { max-height: 48px; width: auto; }

.hl-search {
  display: flex;
  flex: 1;
  max-width: 560px;
  margin: 0;
  background: #fff;
  border: 2px solid var(--hl-ink);
  border-radius: 999px;
  overflow: hidden;
}
.hl-search:focus-within { box-shadow: 0 0 0 4px rgba(11, 110, 105, 0.22); }
.hl-search input[type="search"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hl-ink);
  font: inherit;
  outline: none;
  box-shadow: none;
}
.hl-search button {
  flex: none;
  margin: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 0;
  background: var(--hl-ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.hl-search button:hover,
.hl-search button:focus { background: #0f1a23; color: #fff; }

.hl-quick {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.hl-quick a {
  color: var(--hl-ink);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.hl-quick a:hover { color: var(--hl-link); text-decoration: underline; }

/* แถบหมวดหมู่ */
.hl-catbar {
  position: relative;
  background: var(--hl-ink);
  color: #fff;
}
.hl-catbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
}
.hl-allcats { flex: none; }
.hl-allcats > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 0;
  margin-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.hl-allcats > summary::-webkit-details-marker { display: none; }
.hl-allcats > summary::before {
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.hl-allcats[open] > summary { color: var(--hl-tag); }
.hl-catbar-list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.hl-catbar-list::-webkit-scrollbar { display: none; }
.hl-catbar-list a {
  display: block;
  padding: 12px 12px;
  color: #e3e9ee;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.hl-catbar-list a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* เมนูหมวดหมู่ทั้งหมด */
.hl-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 75vh;
  overflow: auto;
  background: #fff;
  color: var(--hl-ink);
  border-bottom: 1px solid var(--hl-line);
  box-shadow: 0 18px 30px rgba(34, 48, 60, 0.14);
}
.hl-mega-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.hl-mega-cats {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 3 200px;
  column-gap: 28px;
}
.hl-mega-col { break-inside: avoid; margin: 0 0 18px; }
.hl-mega-parent { color: var(--hl-ink); font-weight: 600; text-decoration: none; }
.hl-mega-parent span { color: var(--hl-muted); font-size: 0.82rem; font-weight: 400; }
.hl-mega-parent:hover { color: var(--hl-link); text-decoration: underline; }
.hl-mega-col ul { margin: 6px 0 0; padding: 0; list-style: none; }
.hl-mega-col li a {
  display: block;
  padding: 3px 0;
  color: var(--hl-muted);
  font-size: 0.93rem;
  text-decoration: none;
}
.hl-mega-col li a:hover { color: var(--hl-link); text-decoration: underline; }
.hl-mega-picks { padding-left: 24px; border-left: 1px solid var(--hl-line); }
.hl-mega-title { margin: 0 0 10px; font-weight: 600; }
.hl-mega-picks ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.hl-mega-picks a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 10px;
  color: var(--hl-ink);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}
.hl-mega-picks img {
  grid-row: 1 / 3;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: 8px;
}
.hl-mega-picks a span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hl-mega-picks a:hover span { text-decoration: underline; }

/* ---------- Hero หน้าแรก ---------- */
.hl-home-hero {
  background-color: var(--hl-panel);
  background-image: radial-gradient(circle, #cbd5dd 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--hl-line);
  color: var(--hl-ink);
}
.hl-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-top: 52px;
  padding-bottom: 60px;
}
.hl-home-hero h1 {
  margin: 0 0 14px;
  color: var(--hl-ink);
  font-size: clamp(1.85rem, 1.15rem + 2.4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.25;
}
.hl-hero-lead {
  max-width: 34em;
  margin: 0 0 24px;
  color: #3a4855;
  font-size: 1.08rem;
  line-height: 1.75;
}
.hl-search--hero { max-width: none; }
.hl-search--hero input[type="search"] { padding: 14px 20px; font-size: 1.02rem; }
.hl-search--hero button { padding: 0 28px; }
.hl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.hl-chips a {
  display: block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: 999px;
  color: var(--hl-ink);
  font-size: 0.92rem;
  text-decoration: none;
}
.hl-chips a:hover { border-color: var(--hl-ink); }

/* ดีลแขวนบนบอร์ด: จุดเด่นของหน้าแรก */
.hl-hero-deals-title { margin: 0 0 18px; color: var(--hl-muted); font-size: 0.95rem; font-weight: 600; }
.hl-deals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
}
.hl-deal a {
  position: relative;
  display: block;
  padding: 12px 12px 56px;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius);
  box-shadow: 0 12px 24px rgba(34, 48, 60, 0.1);
  color: var(--hl-ink);
  text-decoration: none;
  transform: rotate(-2.2deg);
  transition: transform 0.2s ease;
}
.hl-deal--2 a { margin-top: 30px; transform: rotate(1.6deg); }
.hl-deal--3 a { margin-top: 8px; transform: rotate(-0.8deg); }
.hl-deal a:hover,
.hl-deal a:focus-visible { transform: rotate(0); }
.hl-deal a::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--hl-cta);
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}
.hl-deal-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.hl-deal-name {
  display: -webkit-box;
  min-height: 2.9em;
  margin-top: 8px;
  overflow: hidden;
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hl-deal-tag {
  position: absolute;
  left: -10px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px 6px 24px;
}
.hl-deal-tag b { font-size: 1.12rem; }
.hl-deal-tag span { font-size: 0.8rem; font-weight: 600; }

/* ---------- ส่วนต่าง ๆ ของหน้าแรก ---------- */
.hl-sec { padding: 44px 0 4px; color: var(--hl-ink); }
.hl-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--hl-ink);
}
.hl-sec-title {
  margin: 0;
  color: var(--hl-ink);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
  font-weight: 700;
  line-height: 1.35;
}
.hl-sec-more { color: var(--hl-link); font-weight: 600; text-decoration: none; white-space: nowrap; }
.hl-sec-more:hover { text-decoration: underline; }

/* การ์ดสินค้า */
.hl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.hl-pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius);
  transition: border-color 0.15s ease;
}
.hl-pcard:hover { border-color: var(--hl-ink); }
.hl-pcard-img {
  position: relative;
  display: block;
  background: #fff;
  border-bottom: 1px solid var(--hl-line);
}
.hl-pcard-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.hl-pcard-off {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 9px;
  background: var(--hl-tag);
  border-radius: 4px;
  color: var(--hl-ink);
  font-size: 0.8rem;
  font-weight: 700;
}
.hl-pcard-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}
.hl-pcard-flag {
  align-self: flex-start;
  padding: 1px 8px;
  background: #e3f2f1;
  border-radius: 999px;
  color: var(--hl-link);
  font-size: 0.75rem;
  font-weight: 600;
}
.hl-pcard-title { margin: 0; font-size: 0.98rem; font-weight: 500; line-height: 1.45; }
.hl-pcard-title a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--hl-ink);
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hl-pcard-title a::after { content: ""; position: absolute; inset: 0; }
.hl-pcard:hover .hl-pcard-title a { text-decoration: underline; }
.hl-pcard-price { margin: auto 0 0; font-size: 1.15rem; }
.hl-pcard-price b { font-weight: 700; }
.hl-pcard-price del { margin-left: 4px; color: var(--hl-muted); font-size: 0.85rem; }
.hl-pcard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  color: var(--hl-muted);
  font-size: 0.82rem;
}
.hl-pcard-rate span { color: #d99a00; }

/* ไทล์หมวดหมู่ */
.hl-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hl-cat {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius);
}
.hl-cat-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  color: var(--hl-ink);
  text-decoration: none;
}
.hl-cat-main img,
.hl-cat-noimg {
  grid-row: 1 / 3;
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--hl-panel);
  border-radius: 10px;
}
.hl-cat-name { align-self: end; font-weight: 600; line-height: 1.35; }
.hl-cat-count { align-self: start; color: var(--hl-muted); font-size: 0.85rem; }
.hl-cat-main:hover .hl-cat-name { text-decoration: underline; }
.hl-cat-kids {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--hl-line);
  list-style: none;
  font-size: 0.88rem;
}
.hl-cat-kids a { color: var(--hl-link); text-decoration: none; }
.hl-cat-kids a:hover { text-decoration: underline; }

/* เราคัดสินค้าอย่างไร (เนื้อหาเขียนในหน้า Home) */
.hl-about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.hl-about-grid li {
  padding: 4px 0 4px 16px;
  border-left: 4px solid var(--hl-tag);
  line-height: 1.7;
}
.hl-about-grid b { display: block; margin-bottom: 2px; }
.hl-about-note { max-width: 70ch; color: var(--hl-muted); font-size: 0.92rem; line-height: 1.7; }

/* ---------- Footer ---------- */
.hl-footer {
  margin-top: 56px;
  background: var(--hl-ink);
  color: #c9d3db;
  font-size: 0.95rem;
  line-height: 1.7;
}
.hl-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 32px;
}
.hl-footer h2 { margin: 0 0 12px; color: #fff; font-size: 1rem; font-weight: 600; }
.hl-footer ul { margin: 0; padding: 0; list-style: none; }
.hl-footer-cats ul { columns: 2 170px; column-gap: 24px; }
.hl-footer li { margin: 0 0 6px; break-inside: avoid; }
.hl-footer a { color: #e9eef2; text-decoration: none; }
.hl-footer a:hover { color: #fff; text-decoration: underline; }
.hl-footer .hl-logo { margin-bottom: 14px; color: #fff; }
.hl-footer-about p { margin: 0 0 12px; }
.hl-footer-note { color: #9fb0bd; font-size: 0.85rem; }
.hl-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 18px;
  padding-bottom: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9fb0bd;
  font-size: 0.85rem;
}
.hl-footer-bottom p { margin: 0; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1024px) {
  .hl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hl-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hl-header-row { flex-wrap: wrap; gap: 10px 16px; min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .hl-search--header { order: 3; flex: 1 0 100%; max-width: none; }
  .hl-quick { gap: 14px; font-size: 0.92rem; }
  .hl-mega-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hl-mega-picks { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--hl-line); }
  .hl-mega-cats { columns: 2 150px; }

  .hl-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; padding-bottom: 36px; }
  .hl-deals {
    display: flex;
    gap: 16px;
    /*margin: 0 -16px;*/
    padding: 12px 16px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .hl-deal { flex: 0 0 46%; scroll-snap-align: start; }

  .hl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hl-grid--scroll {
    display: flex;
    margin: 0 -16px;
    padding: 0 16px 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .hl-grid--scroll .hl-pcard { flex: 0 0 46%; scroll-snap-align: start; }
  .hl-pcard-body { padding: 10px 10px 12px; }
  .hl-pcard-title { font-size: 0.92rem; }
  .hl-pcard-price { font-size: 1.05rem; }
  .hl-cats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hl-about-grid { grid-template-columns: minmax(0, 1fr); }

  .hl-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 36px; }
  .single-post .hl-footer { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .hl-deal a,
  .hl-pcard { transition: none; }
}

/* ==========================================================================
   หน้า archive: หมวด แท็ก ผลค้นหา [hl_archive]
   ========================================================================== */
.elementor-location-archive .e-con:has(.hl-archive),
[data-elementor-type="archive"] .e-con:has(.hl-archive) {
  --padding-top: 0px;
  --padding-right: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
  --content-width: 100%;
  --gap: 0px;
  padding: 0 !important;
}
.elementor-location-archive .e-con:has(.hl-archive) > .e-con-inner,
[data-elementor-type="archive"] .e-con:has(.hl-archive) > .e-con-inner { max-width: none; padding: 0; }

.hl-archive { color: var(--hl-ink); }
.hl-archive a:focus-visible { outline: 3px solid var(--hl-link); outline-offset: 2px; }

.hl-arch-head {
  padding: 22px 0 26px;
  background-color: var(--hl-panel);
  background-image: radial-gradient(circle, #cbd5dd 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--hl-line);
}
.hl-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--hl-muted);
  font-size: 0.88rem;
}
.hl-crumbs li + li::before { content: "›"; margin-right: 4px; color: #9aa7b2; }
.hl-crumbs a { color: var(--hl-link); text-decoration: none; }
.hl-crumbs a:hover { text-decoration: underline; }
.hl-arch-title {
  margin: 0 0 8px;
  color: var(--hl-ink);
  font-size: clamp(1.65rem, 1.2rem + 1.7vw, 2.4rem);
  font-weight: 700;
  line-height: 1.3;
}
.hl-arch-desc { max-width: 68ch; color: #3a4855; line-height: 1.75; }
.hl-arch-desc p { margin: 0 0 8px; }
.hl-arch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 6px 0 0;
  color: var(--hl-muted);
  font-size: 0.95rem;
}
.hl-arch-stats b { color: var(--hl-ink); font-weight: 700; }
.hl-search--archive { max-width: 620px; margin-top: 16px; }
.hl-arch-subs { margin-top: 16px; }
.hl-arch-subs a span { color: var(--hl-muted); font-size: 0.82rem; }
.hl-chips a[aria-current="page"] { background: var(--hl-ink); border-color: var(--hl-ink); color: #fff; }
.hl-chips a[aria-current="page"] span { color: #c9d3db; }

.hl-arch-body { padding-top: 28px; }
.hl-arch-h2 { margin: 0; color: var(--hl-ink); font-size: 1.25rem; font-weight: 700; line-height: 1.4; }
.hl-arch-h2 span { margin-left: 8px; color: var(--hl-muted); font-size: 0.9rem; font-weight: 400; }

/* ขายดีในหมวด: แถบเด่นบนพื้นเหลืองอ่อน */
.hl-arch-best {
  margin: 0 0 32px;
  padding: 18px 18px 20px;
  background: #fff8d6;
  border: 1px solid #f3e39a;
  border-radius: var(--hl-radius);
}
.hl-arch-best .hl-arch-h2 { margin-bottom: 14px; }

.hl-arch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--hl-ink);
}
.hl-sort { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hl-sort ul { flex: 1 1 auto; min-width: 0; }
.hl-sort > span { color: var(--hl-muted); font-size: 0.9rem; white-space: nowrap; }
.hl-sort ul {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.hl-sort ul::-webkit-scrollbar { display: none; }
.hl-sort a {
  display: block;
  padding: 5px 12px;
  background: #fff;
  border: 1px solid var(--hl-line);
  border-radius: 999px;
  color: var(--hl-ink);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.hl-sort a:hover { border-color: var(--hl-ink); }
.hl-sort a[aria-current="true"] { background: var(--hl-ink); border-color: var(--hl-ink); color: #fff; }

.hl-pcard--plain .hl-pcard-excerpt { margin: 0; color: var(--hl-muted); font-size: 0.88rem; }

/* paginate_links() also puts .page-numbers on the <ul>, so style the list and the buttons separately */
.hl-pager ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin: 36px 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  line-height: inherit;
  list-style: none;
}
.hl-pager li { margin: 0; }
.hl-pager li > .page-numbers {
  display: block;
  min-width: 42px;
  padding: 0 12px;
  border: 1px solid var(--hl-line);
  border-radius: 10px;
  color: var(--hl-ink);
  line-height: 40px;
  text-align: center;
  text-decoration: none;
}
.hl-pager a.page-numbers:hover { border-color: var(--hl-ink); }
.hl-pager .page-numbers.current { background: var(--hl-ink); border-color: var(--hl-ink); color: #fff; }
.hl-pager .page-numbers.dots { border-color: transparent; }

.hl-arch-empty { padding-top: 32px; padding-bottom: 24px; }
.hl-arch-empty p { margin: 0 0 14px; font-size: 1.05rem; }

@media (max-width: 860px) {
  .hl-arch-head { padding: 16px 0 20px; }
  .hl-arch-subs { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; overflow-x: auto; scrollbar-width: none; }
  .hl-arch-subs a { white-space: nowrap; }
  .hl-arch-toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .hl-sort { margin-right: -16px; }
  .hl-arch-best { margin-left: -16px; margin-right: -16px; padding: 14px 16px 16px; border-left: 0; border-right: 0; border-radius: 0; }
}

/* ==========================================================================
   หน้าสินค้า: สินค้าอื่นในหมวด (ปลั๊กอินต่อท้ายเนื้อหาโพสต์)
   พื้นบอร์ดลายจุดแบบหัวหน้าหมวด การ์ดชุดเดียวกับหน้าแรก
   ========================================================================== */
.hl-rel {
  box-sizing: border-box;
  margin: 12px 0 48px;
  padding: 22px 22px 24px;
  background-color: var(--hl-panel);
  background-image: radial-gradient(circle, #cbd5dd 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  border: 1px solid var(--hl-line);
  border-radius: var(--hl-radius);
  color: var(--hl-ink);
}
.hl-rel a:focus-visible { outline: 3px solid var(--hl-link); outline-offset: 2px; }
.hl-rel .hl-rel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 16px;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--hl-ink);
}
.hl-rel .hl-rel-title {
  margin: 0;
  color: var(--hl-ink);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem);
  font-weight: 700;
  line-height: 1.4;
}
.hl-rel .hl-rel-more { color: var(--hl-link); font-weight: 600; text-decoration: none; white-space: nowrap; }
.hl-rel .hl-rel-more:hover { text-decoration: underline; }
.hl-rel .hl-rel-sub { grid-column: 1 / -1; margin: 0; color: var(--hl-muted); font-size: 0.88rem; }
.hl-rel .hl-rel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.hl-rel .hl-pcard { box-shadow: 0 8px 18px rgba(34, 48, 60, 0.07); }
.hl-rel .hl-pcard:hover { border-color: var(--hl-ink); }
.hl-rel .hl-rel-cats { margin-top: 22px; }
.hl-rel .hl-rel-cats-label { margin: 0; color: var(--hl-muted); font-size: 0.88rem; font-weight: 600; }
.hl-rel .hl-chips { margin-top: 10px; }
.hl-rel .hl-chips a span { color: var(--hl-muted); font-size: 0.82rem; }

@media (max-width: 860px) {
  .hl-rel { margin: 8px 0 32px; padding: 16px 14px 18px; }
  .hl-rel .hl-rel-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; padding-bottom: 10px; }
  .hl-rel .hl-rel-more { grid-row: 3; margin-top: 4px; }
  .hl-rel .hl-rel-grid { gap: 12px; margin: 0 -14px; padding: 0 14px 8px; }
  .hl-rel .hl-rel-grid .hl-pcard { flex: 0 0 44%; }
  .hl-rel .hl-chips { flex-wrap: nowrap; margin-right: -14px; padding-right: 14px; overflow-x: auto; scrollbar-width: none; }
  .hl-rel .hl-chips a { white-space: nowrap; }
}
