/* Product Directory V5 — compact premium category index.
   Scoped to .linksSection; does not affect the premium footer or admin UI. */
.linksSection {
  --pc-ink: #0b2946;
  --pc-navy: #071b32;
  --pc-blue: #12659e;
  --pc-cyan: #48c9e9;
  --pc-muted: #58718a;
  --pc-hairline: #dce8f2;
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: clamp(45px, 6vw, 78px) 0 clamp(50px, 7vw, 88px);
  background:
    radial-gradient(ellipse 60% 44% at 4% 1%, rgba(32,153,199,.10), transparent 85%),
    radial-gradient(ellipse 44% 40% at 99% 86%, rgba(22,101,158,.08), transparent 86%),
    linear-gradient(180deg,#eaf3f9 0%,#f4f9fd 57%,#f7fbfd 100%);
  color: var(--pc-ink);
  font-family: "Noto Sans Thai", "Sarabun", Tahoma, system-ui, sans-serif;
}
.linksSection *, .linksSection *::before, .linksSection *::after { box-sizing: border-box; }
.linksSection .wrap { position: relative; z-index: 1; }
.linksSection .sectionHead {
  position: relative;
  z-index: 0;
  margin: 0;
  max-width: none;
  min-height: 180px;
  overflow: hidden;
  padding: clamp(25px, 3.3vw, 43px) clamp(23px, 4.1vw, 51px) 56px;
  text-align: left;
  color: #fff;
  border-radius: 26px 26px 0 0;
  border: 1px solid rgba(116, 197, 242, .20);
  background:
    radial-gradient(ellipse 50% 115% at 92% 11%, rgba(48,184,227,.23), transparent 78%),
    radial-gradient(ellipse 60% 120% at -9% 120%, rgba(24,108,185,.23), transparent 80%),
    linear-gradient(115deg, #071b31 0%, #082947 51%, #0b3c60 100%);
  box-shadow: 0 18px 38px rgba(5,36,66,.16);
}
.linksSection .sectionHead::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  top: -155px;
  right: -70px;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(156,222,248,.13);
  box-shadow: 0 0 0 40px rgba(156,222,248,.025), 0 0 0 85px rgba(156,222,248,.025), 0 0 0 130px rgba(156,222,248,.017);
}
.linksSection .sectionHead::after {
  content: "";
  position: absolute;
  width: 148px;
  height: 2px;
  left: clamp(23px, 4.1vw, 51px);
  bottom: 30px;
  border-radius: 10px;
  background: linear-gradient(90deg,#5bdbeb,rgba(91,219,235,0));
}
.linksSection .bc-category-eyebrow {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
  color: #91dcea;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .17em;
  line-height: 1.4;
}
.linksSection .bc-category-eyebrow::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 18px;
  height: 3px;
  background: #68dfef;
  border-radius: 4px;
}
.linksSection .sectionHead h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 7px;
  max-width: 850px;
  color: #f4fbff;
  font-size: clamp(25px, 3vw, 39px);
  font-weight: 900;
  line-height: 1.37;
  letter-spacing: -.035em;
  text-shadow: none;
}
.linksSection .bc-category-intro {
  margin: 0;
  max-width: 850px;
  color: #b8d5e8;
  font-size: clamp(12px, 1.25vw, 14px);
  line-height: 1.8;
  font-weight: 500;
}
.linksSection .bc-category-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: -17px 19px 0;
  padding: 14px 17px;
  border: 1px solid #dce8f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(10,45,74,.09), 0 2px 5px rgba(6,45,81,.035);
}
.linksSection .bc-category-search {
  display: flex;
  min-width: 220px;
  max-width: 100%;
  flex: 1 1 310px;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid #d6e5f1;
  border-radius: 10px;
  background: #f6fafd;
  transition: border-color .17s ease, box-shadow .17s ease, background .17s ease;
}
.linksSection .bc-category-search:focus-within {
  border-color: #2c94bf;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(56,167,213,.14);
}
.linksSection .bc-category-search-icon { display: flex; flex: none; color: #5487a7; }
.linksSection .bc-category-search-icon svg { display: block; width: 19px; height: 19px; }
.linksSection .bc-category-search input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  outline: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #163a57;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}
.linksSection .bc-category-search input::placeholder { color: #758fa5; font-weight: 500; opacity: 1; }
.linksSection .bc-category-reset {
  flex: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #e4edf4;
  color: #446982;
  font: 700 18px/1 Arial,sans-serif;
  cursor: pointer;
}
.linksSection .bc-category-reset.is-visible { display: inline-flex; }
.linksSection .bc-category-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.linksSection .bc-category-count {
  margin: 0;
  color: #5c758a;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  white-space: nowrap;
  text-align: right;
}
.linksSection .bc-category-count strong { color: #0a3d60; font-size: 14px; font-weight: 900; }
.linksSection .bc-category-expand {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #c9dfea;
  border-radius: 9px;
  background: #edf7fc;
  color: #0c5278;
  cursor: pointer;
  font: 800 12px/1.5 "Noto Sans Thai", "Sarabun", Tahoma, sans-serif;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.linksSection .bc-category-expand svg { flex: none; display: block; width: 15px; height: 15px; transition: transform .16s ease; }
.linksSection .bc-category-expand:hover { border-color: #8cbcd3; background: #ddf1fa; }
.linksSection .bc-category-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.linksSection .bc-category-expand:disabled { opacity: .45; cursor: default; }
.linksSection .linkBox {
  padding: 37px clamp(13px, 1.8vw, 23px) 23px;
  margin: 0;
  border: 1px solid #dde9f2;
  border-top: 0;
  border-radius: 0 0 26px 26px;
  background: linear-gradient(180deg,#fff 0%,#f9fcfe 100%);
  box-shadow: 0 18px 40px rgba(9,56,96,.085);
}
.linksSection .categoryGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  align-items: start;
  gap: 11px;
  counter-reset: bc-category;
}
.linksSection .catGroup {
  --pc-accent: #438eb5;
  counter-increment: bc-category;
  position: relative;
  align-self: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce8f0;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 11px rgba(23,66,104,.045);
  transition: border-color .19s ease, box-shadow .19s ease, transform .19s ease;
}
.linksSection .catGroup:nth-child(5n+2) { --pc-accent: #167eab; }
.linksSection .catGroup:nth-child(5n+3) { --pc-accent: #5482a9; }
.linksSection .catGroup:nth-child(5n+4) { --pc-accent: #21a5b9; }
.linksSection .catGroup:nth-child(5n+5) { --pc-accent: #4075aa; }
.linksSection .catGroup[hidden], .linksSection .catLinks a[hidden] { display: none !important; }
.linksSection .catGroup:not([open]):hover { transform: translateY(-2px); border-color: #a3cde0; box-shadow: 0 9px 23px rgba(20,90,141,.11); }
.linksSection .catGroup::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--pc-accent); opacity: .7; z-index: 1; pointer-events: none; }
.linksSection .catGroup > summary {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto 14px;
  gap: 9px;
  align-items: center;
  min-height: 79px;
  padding: 13px 13px 13px 15px;
  margin: 0;
  list-style: none;
  cursor: pointer;
  background: linear-gradient(116deg,#fff 0%,#fbfdff 100%);
  color: #0b2d49;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.55;
  text-align: left;
  user-select: none;
  transition: background .16s ease;
}
.linksSection .catGroup > summary::-webkit-details-marker { display: none; }
.linksSection .catGroup > summary::marker { content: ""; }
.linksSection .catGroup > summary::before {
  content: counter(bc-category,decimal-leading-zero);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #d3e7f1;
  border-radius: 9px;
  background: #edf7fc;
  color: var(--pc-accent);
  font: 850 11px/1 system-ui, sans-serif;
  letter-spacing: -.01em;
}
.linksSection .catGroup > summary::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6c92a9;
  border-bottom: 2px solid #6c92a9;
  transform: rotate(45deg) translate(-2px,-2px);
  transition: transform .16s ease;
}
.linksSection .catGroup > summary > span { display: block; min-width: 0; color: inherit; font-size: inherit; line-height: 1.5; }
.linksSection .catGroup > summary > em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px 8px;
  max-width: 90px;
  border: 1px solid #d9e8f2;
  border-radius: 7px;
  background: #f0f6fa;
  color: #5b7a91;
  font: 750 10px/1.35 "Noto Sans Thai", "Sarabun", Tahoma, sans-serif;
  text-align: center;
  white-space: nowrap;
}
.linksSection .catGroup[open] { grid-column: 1 / -1; border-color: #b5d8e8; box-shadow: 0 14px 32px rgba(16,71,116,.10); }
.linksSection .catGroup[open]::before { width: 4px; background: #42bfe0; opacity: 1; }
.linksSection .catGroup[open] > summary { background: linear-gradient(100deg,#0b3659,#11537c); color: #fff; }
.linksSection .catGroup[open] > summary::before { color: #b8effe; border-color: rgba(136,223,247,.27); background: rgba(116,216,251,.11); }
.linksSection .catGroup[open] > summary > em { color: #d0eef9; background: rgba(255,255,255,.10); border-color: rgba(171,223,246,.22); }
.linksSection .catGroup[open] > summary::after { border-color: #a9e6f7; transform: rotate(225deg) translate(-2px,-2px); }
.linksSection .catLinks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 16px;
  background: linear-gradient(180deg,#f4f9fc 0%,#fafdff 100%);
}
.linksSection .catLinks a {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  margin: 0;
  border: 1px solid #e0eaf2;
  border-radius: 8px;
  background: #fff;
  color: #254e6b;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.linksSection .catLinks a::before { content: ""; display: block; flex: none; width: 5px; height: 5px; border-radius: 50%; background: #6fb8d6; }
.linksSection .catLinks a::after { content: "›"; margin-left: auto; flex: none; color: #83a7be; font: 600 18px/1 Arial,sans-serif; }
.linksSection .catLinks a:hover { transform: none; color: #07547e; border-color: #93cee3; background: #f1fbff; box-shadow: 0 3px 10px rgba(29,111,151,.075); }
.linksSection .catLinks a:focus-visible, .linksSection .catGroup > summary:focus-visible, .linksSection .bc-category-expand:focus-visible, .linksSection .bc-category-reset:focus-visible { outline: 3px solid #2c95c2; outline-offset: 3px; }
.linksSection .bc-category-empty { display: none; padding: 24px 18px; margin-top: 8px; border: 1px dashed #b1cfdf; border-radius: 12px; text-align: center; color: #456984; background: #f4faff; font-size: 14px; }
.linksSection .bc-category-empty.is-visible { display: block; }
.linksSection .bc-category-footnote { margin: 17px 3px 0; text-align: center; color: #6b8396; font-size: 11px; font-weight: 550; line-height: 1.7; }
/* A lone final category becomes a tasteful full-width final row on large screens. */
@media (min-width:1101px) {
  .linksSection .catGroup:last-child:nth-child(3n+1):not([open]) { grid-column: 1 / -1; }
  .linksSection .catGroup:last-child:nth-child(3n+1):not([open]) > summary {
    min-height: 68px;
    background: linear-gradient(110deg,#f0faff,#ffffff 84%);
  }
}
@media (max-width:1100px) {
  .linksSection .categoryGrid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .linksSection .catLinks { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .linksSection .sectionHead { min-height: 155px; padding: 27px 26px 49px; }
  .linksSection .sectionHead::after { left: 26px; }
  .linksSection .bc-category-toolbar { margin: -15px 12px 0; gap: 11px; padding: 12px; }
  .linksSection .bc-category-search { flex-basis: 100%; }
  .linksSection .bc-category-meta { flex: 1 1 100%; justify-content: space-between; }
  .linksSection .linkBox { padding-top: 32px; }
  .linksSection .catLinks { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .linksSection { padding: 39px 0 49px; }
  .linksSection .sectionHead { border-radius: 18px 18px 0 0; min-height: 157px; padding: 24px 19px 46px; }
  .linksSection .sectionHead::after { left: 19px; bottom: 24px; }
  .linksSection .sectionHead h2 { font-size: clamp(24px,7vw,30px); margin-bottom: 7px; }
  .linksSection .bc-category-intro { font-size: 12px; line-height: 1.65; }
  .linksSection .bc-category-toolbar { margin: -12px 10px 0; border-radius: 12px; }
  .linksSection .bc-category-search { min-width: 0; min-height: 41px; }
  .linksSection .bc-category-count { font-size: 11px; }
  .linksSection .bc-category-expand { font-size: 11px; min-height: 39px; padding: 7px 11px; }
  .linksSection .linkBox { border-radius: 0 0 18px 18px; padding: 30px 11px 15px; }
  .linksSection .categoryGrid { grid-template-columns: 1fr; gap: 8px; }
  .linksSection .catGroup { border-radius: 11px; }
  .linksSection .catGroup > summary { display: grid; grid-template-columns: 31px minmax(0,1fr) auto 12px; min-height: 66px; padding: 10px 11px 10px 13px; gap: 9px; font-size: 13px; }
  .linksSection .catGroup > summary > em { font-size: 10px; padding: 4px 7px; }
  .linksSection .catLinks { grid-template-columns: 1fr; padding: 10px; gap: 6px; }
  .linksSection .catLinks a { font-size: 12px; min-height: 39px; padding: 8px 10px; }
}
@media (prefers-reduced-motion:reduce) {
  .linksSection .catGroup, .linksSection .catGroup > summary, .linksSection .catLinks a, .linksSection .bc-category-expand, .linksSection .bc-category-expand svg { transition: none !important; }
}
