/* AG-COM Catalog Front Door. Everything is scoped to .agcfd so Flatsome styles don't leak in or out. */
.agcfd {
  --agcfd-maroon: #5c0000;
  --agcfd-ink: #1a1a1a;
  --agcfd-muted: #5f5f5f;
  --agcfd-line: #ece6e5;
  --agcfd-line-2: #cfc6c4;
  --agcfd-glow: 0 0 0 3px rgba(92,0,0,0.12);
  /* One card size for types, families, groups and diagrams (the diagram picker's size). */
  --agcfd-card-min: 180px;
  --agcfd-card-pic: 120px;
  font-family: 'Nokora', system-ui, sans-serif;
  color: var(--agcfd-ink);
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 16px clamp(16px, 2.5vw, 40px) 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
  scroll-margin-top: var(--agcfd-header, 0px);
}
.agcfd *, .agcfd *::before, .agcfd *::after { box-sizing: border-box; }

/* Reset Flatsome's button / input / heading defaults inside the front door */
.agcfd button {
  font: inherit; color: inherit; text-transform: none; letter-spacing: normal;
  margin: 0; line-height: 1.25; box-shadow: none; min-height: 0; text-shadow: none;
  cursor: pointer; vertical-align: middle;
}
.agcfd button:disabled { cursor: default; }
.agcfd h1, .agcfd h2, .agcfd h3, .agcfd h4 { margin: 0; padding: 0; text-transform: none; letter-spacing: normal; }
.agcfd p { margin: 0; }
.agcfd img { max-width: 100%; }
.agcfd [hidden] { display: none !important; }
.agcfd :focus-visible { outline: 3px solid #ffa810; outline-offset: 2px; }
.agcfd-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.agcfd-ph { font-size: 12px; color: #6b6b6b; padding: 0 6px; text-align: center; }

/* ---- Banner: maroon + drawing texture; breadcrumb trail, title, smart search. Sticks under the site header. ---- */
.agcfd-sentinel { display: block; height: 1px; margin-bottom: -23px; }
.agcfd-banner {
  position: sticky; top: var(--agcfd-sticky-top, 0px); z-index: 30; isolation: isolate;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px;
  padding: 14px 22px 18px; border-radius: 12px; background: var(--agcfd-maroon); color: #fff;
}
.agcfd .agcfd-banner:has(.agcs.is-full) { z-index: 100000; }
.agcfd-banner.is-stuck { padding-top: 10px; padding-bottom: 10px; border-radius: 0 0 12px 12px; box-shadow: 0 6px 14px -8px rgba(0,0,0,0.45); align-items: center; }
.agcfd-banner.is-stuck .agcfd-h1, .agcfd-banner.is-stuck .agcfd-intro { display: none; }
.agcfd-banner-tex {
  position: absolute; inset: 0 0 0 30%; z-index: -1; border-radius: 0 12px 12px 0; overflow: hidden;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: grayscale(1) invert(1) contrast(1.4); mix-blend-mode: screen; opacity: 0.22;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%); mask-image: linear-gradient(to right, transparent 0%, #000 55%);
  pointer-events: none;
}
.agcfd-banner-left { flex: 1 1 420px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agcfd-crumbrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.agcfd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 14px; color: rgba(255,255,255,0.8); min-width: 0; }
.agcfd .agcfd-crumbs a, .agcfd .agcfd-crumbs a:hover { color: rgba(255,255,255,0.85); }
.agcfd .agcfd-linkbtn { background: none; border: 0; padding: 0; color: rgba(255,255,255,0.85); text-decoration: underline; font-size: 14px; }
.agcfd-crumb-trail { display: contents; }
.agcfd-crumb-sep { color: rgba(255,255,255,0.5); }
.agcfd .agcfd-crumb-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 4px; border: 0; background: none;
  font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 15px; color: rgba(255,255,255,0.85);
}
.agcfd .agcfd-crumb-chip:hover { color: #fff; text-decoration: underline; }
.agcfd .agcfd-crumb-chip.is-last { color: #fff; }
.agcfd-crumb-logo { display: inline-flex; align-items: center; height: 24px; padding: 2px 6px; border-radius: 5px; background: #fff; }
.agcfd-crumb-logo img { height: 18px; width: auto; max-width: 80px; object-fit: contain; }
.agcfd-banner-tools { display: flex; gap: 8px; }
.agcfd .agcfd-bbtn { min-height: 32px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.55); border-radius: 8px; background: none; color: #fff; font-size: 13px; }
.agcfd .agcfd-bbtn:hover { background: rgba(255,255,255,0.12); }
.agcfd [data-agcfd-top] { display: none; }
.agcfd .agcfd-banner.is-stuck [data-agcfd-top] { display: inline-flex; align-items: center; }
.agcfd .agcfd-h1 { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 32px; line-height: 1.15; color: #fff; }
.agcfd-intro { font-size: 15px; color: rgba(255,255,255,0.85); }
.agcfd-banner-search { flex: 0 1 420px; min-width: 240px; color: var(--agcfd-ink); }

/* Own machine filter box (only when AG-COM Search is off) */
.agcfd-search { position: relative; }
.agcfd-search-ico { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--agcfd-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.agcfd .agcfd-search input[type="search"] {
  min-height: 46px; height: 46px; padding: 0 14px 0 42px; margin: 0; border: 1px solid #fff; border-radius: 8px;
  font-size: 16px; font-family: inherit; color: var(--agcfd-ink); background: #fff; box-shadow: none; width: 100%; max-width: none;
}
.agcfd .agcfd-search input[type="search"]::placeholder { color: #6b6b6b; }
.agcfd .agcfd-search input[type="search"]:focus { outline: 3px solid #ffa810; outline-offset: 1px; }

/* ---- 2.0.3 serial number box (under the search, inside makes / series that have serial ranges) ---- */
.agcfd-serial[hidden], .agcfd-serial-clear[hidden] { display: none !important; }
.agcfd-serial { margin-top: 8px; }
.agcfd-serial-form { display: flex; gap: 6px; align-items: stretch; }
.agcfd .agcfd-serial-form input[type="text"] {
  flex: 1 1 auto; min-width: 0; min-height: 40px; height: 40px; padding: 0 12px; margin: 0; border: 1px solid #fff; border-radius: 8px;
  font-size: 16px; font-family: inherit; color: var(--agcfd-ink); background: #fff; box-shadow: none;
}
.agcfd .agcfd-serial-form input[type="text"]::placeholder { color: #6b6b6b; }
.agcfd .agcfd-serial-form input[type="text"]:focus { outline: 3px solid #ffa810; outline-offset: 1px; }
.agcfd .agcfd-serial-go, .agcfd .agcfd-serial-clear {
  flex: 0 0 auto; min-height: 40px; height: 40px; margin: 0; padding: 0 14px; border: 1px solid #fff; border-radius: 8px;
  background: transparent; color: #fff; font: 700 14px/1 'Noto Sans', sans-serif; text-transform: none; letter-spacing: 0; cursor: pointer;
}
.agcfd .agcfd-serial-go:hover, .agcfd .agcfd-serial-clear:hover { background: rgba(255,255,255,.14); }
.agcfd .agcfd-serial-clear { padding: 0 12px; }
.agcfd-serial-msg { margin-top: 6px; font-size: 13px; line-height: 1.4; color: #fff; }
.agcfd-serial-msg:empty { display: none; }
.agcfd .agcfd-serial-pick {
  display: inline-block; margin: 4px 6px 0 0; padding: 4px 10px; min-height: 0; border: 1px solid #fff; border-radius: 999px;
  background: #fff; color: var(--agcfd-maroon); font: 700 13px/1.3 'Noto Sans', sans-serif; text-transform: none; letter-spacing: 0; cursor: pointer;
}
.agcfd-modelbtn-serial { font-size: 12px; font-weight: 700; color: #1d6b2f; }
.agcfd-diagram-fits { font-size: 12px; font-weight: 700; color: #6b4a10; }
.agcfd-serial-off { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #fbf3df; color: #6b4a10; font-size: 13px; }
.agcfd-notfit { margin-top: 12px; }
.agcfd-notfit-sum { cursor: pointer; font-size: 13px; color: var(--agcfd-muted); padding: 6px 0; }
.agcfd-notfit[open] .agcfd-notfit-sum { margin-bottom: 8px; }

/* ---- Pick up where you left off ---- */
.agcfd-recent { display: flex; flex-direction: column; gap: 8px; }
.agcfd-recent-row { display: flex; flex-wrap: wrap; gap: 10px; }
.agcfd .agcfd-recent-card {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 14px 6px 6px;
  border: 1px solid var(--agcfd-line); border-radius: 10px; background: #fff; text-align: left; max-width: 280px;
}
.agcfd .agcfd-recent-card:hover { border-color: var(--agcfd-maroon); }
.agcfd-recent-pic { flex: 0 0 64px; height: 44px; display: flex; align-items: center; justify-content: center; }
.agcfd-recent-pic img { max-height: 44px; object-fit: contain; }
.agcfd-recent-txt { display: flex; flex-direction: column; min-width: 0; }
.agcfd-recent-brand { font-size: 12px; color: var(--agcfd-muted); }
.agcfd-recent-name { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 14px; color: var(--agcfd-maroon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agcfd-section { display: flex; flex-direction: column; gap: 10px; }
.agcfd .agcfd-label { font-family: 'Noto Sans', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--agcfd-muted); }
.agcfd .agcfd-h2 { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 22px; color: var(--agcfd-ink); }

/* Divider with its label set into the line */
.agcfd-rule { display: flex; align-items: center; gap: 14px; }
.agcfd-rule::before, .agcfd-rule::after { content: ''; flex: 1 1 auto; border-top: 1px solid var(--agcfd-line-2); }
.agcfd-rule span { font-family: 'Noto Sans', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--agcfd-muted); }

/* ---- Brand tiles: logo on top, name under (own size) ---- */
.agcfd-brands { display: flex; flex-wrap: wrap; gap: 10px; }
.agcfd .agcfd-brand {
  width: 128px; min-height: 92px; padding: 10px 8px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; color: var(--agcfd-ink); border: 1px solid var(--agcfd-line);
}
.agcfd .agcfd-brand:hover { border-color: var(--agcfd-maroon); }
.agcfd .agcfd-brand.is-on { border-color: var(--agcfd-maroon); box-shadow: var(--agcfd-glow); }
.agcfd-brand-logo { height: 40px; width: 100%; display: flex; align-items: center; justify-content: center; }
.agcfd-brand-logo img { max-height: 40px; max-width: 100%; width: auto; object-fit: contain; }
.agcfd-brand-mono { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--agcfd-line); color: var(--agcfd-maroon); display: flex; align-items: center; justify-content: center; font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 18px; }
.agcfd-all-ico { width: 28px; height: 28px; fill: none; stroke: var(--agcfd-maroon); stroke-width: 1.8; stroke-linejoin: round; }
.agcfd-brand-name { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 14px; text-align: center; line-height: 1.2; }

/* ---- One card: types, families, groups, diagrams ---- */
.agcfd-types, .agcfd-famgrid, .agcfd-groups, .agcfd-diagrams {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--agcfd-card-min), 1fr)); gap: 10px;
}
.agcfd .agcfd-type, .agcfd .agcfd-fam, .agcfd .agcfd-groupcard, .agcfd .agcfd-diagram {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 8px 10px;
  border: 1px solid var(--agcfd-line); border-radius: 10px; background: #fff; color: var(--agcfd-ink);
  text-align: left; text-decoration: none;
}
.agcfd .agcfd-type:hover:not(:disabled), .agcfd .agcfd-fam:hover, .agcfd .agcfd-groupcard:hover, .agcfd .agcfd-diagram:hover {
  border-color: var(--agcfd-maroon); color: var(--agcfd-ink);
}
.agcfd .agcfd-type.is-on, .agcfd .agcfd-fam.is-open, .agcfd .agcfd-groupcard.is-on {
  border-color: var(--agcfd-maroon); box-shadow: var(--agcfd-glow);
}
.agcfd .agcfd-type:disabled { opacity: 0.45; }
.agcfd-type-pic, .agcfd-fam-pic, .agcfd-groupcard-pic, .agcfd-diagram-pic {
  width: 100%; height: var(--agcfd-card-pic); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff;
}
.agcfd-type-pic img, .agcfd-fam-pic img, .agcfd-groupcard-pic img, .agcfd-diagram-pic img { width: 100%; height: 100%; object-fit: contain; }
.agcfd-type-name, .agcfd-groupcard-name, .agcfd-diagram-name, .agcfd-fam .agcfd-name {
  font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 14px; line-height: 1.25;
}
.agcfd-fam .agcfd-name { color: var(--agcfd-maroon); }
.agcfd-fam-brand, .agcfd-diagram-code, .agcfd-meta { font-size: 12px; color: var(--agcfd-muted); }
.agcfd .agcfd-meta.is-open { color: var(--agcfd-maroon); font-weight: 700; }

.agcfd .agcfd-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--agcfd-maroon); color: #fff; font-size: 14px; }
.agcfd-note { font-size: 15px; color: var(--agcfd-muted); }
.agcfd-empty { padding: 32px 16px; text-align: center; border: 1px dashed #d9d2d0; border-radius: 10px; color: var(--agcfd-muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ---- Results: a section per type, family tiles inside ---- */
[data-agcfd-results] { display: flex; flex-direction: column; gap: 30px; padding-top: 6px; }
.agcfd-typesec { display: flex; flex-direction: column; gap: 10px; }
.agcfd .agcfd-typesec-h { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 22px; color: var(--agcfd-maroon); }
.agcfd-step { font-size: 14px; color: var(--agcfd-muted); margin-top: -4px; }

/* ---- Family panel: models left, groups right, diagrams under the picked group's row ---- */
.agcfd-panel {
  grid-column: 1 / -1; border: 2px solid var(--agcfd-maroon); border-radius: 12px; background: #fff;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.agcfd-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agcfd .agcfd-panel-title { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 20px; color: var(--agcfd-ink); }
.agcfd-panel-brand { color: var(--agcfd-muted); font-weight: 400; }
.agcfd .agcfd-panel-close { width: 44px; height: 44px; border: 1px solid var(--agcfd-line); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.agcfd-x { width: 18px; height: 18px; fill: none; stroke: var(--agcfd-ink); stroke-width: 2; stroke-linecap: round; }
.agcfd .agcfd-panel-label { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 15px; color: var(--agcfd-maroon); }
.agcfd-panel-none { color: var(--agcfd-muted); }
.agcfd-panel-body { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-start; }
.agcfd-models { flex: 0 1 270px; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.agcfd-modellist { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; padding: 2px; }
.agcfd .agcfd-modelbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: 48px; padding: 8px 12px; border: 1px solid var(--agcfd-line); border-radius: 8px;
  background: #fff; color: var(--agcfd-ink); text-align: left;
}
.agcfd .agcfd-modelbtn:hover { border-color: var(--agcfd-maroon); }
.agcfd .agcfd-modelbtn.is-on { border: 2px solid var(--agcfd-maroon); box-shadow: var(--agcfd-glow); padding: 7px 11px; }
.agcfd-modelbtn-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agcfd-modelbtn-name { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 15px; }
.agcfd .agcfd-modelbtn.is-on .agcfd-modelbtn-name { color: var(--agcfd-maroon); }
.agcfd-modelbtn-note { font-size: 13px; color: var(--agcfd-muted); line-height: 1.3; }
.agcfd-chev { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--agcfd-maroon); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.agcfd-groupsside { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.agcfd-pick-hint { color: var(--agcfd-muted); font-size: 15px; padding: 28px 0; }
.agcfd-drawer { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #faf7f6; border: 1px solid var(--agcfd-line); border-radius: 10px; }

/* Scrolling something into view stops below the site header + the stuck banner. */
.agcfd-panel, .agcfd-drawer, .agcfd-fam, .agcfd-groupsside { scroll-margin-top: calc(var(--agcfd-cover, 0px) + 12px); }

@media (max-width: 600px) {
  .agcfd { --agcfd-card-pic: 90px; }
  .agcfd .agcfd-h1 { font-size: 26px; }
  .agcfd-banner { padding: 12px 14px 14px; }
  .agcfd-banner-search { flex-basis: 100%; }
  .agcfd-banner.is-stuck .agcfd-banner-search { display: none; } /* keep the stuck bar slim on phones */
  .agcfd-banner-tex { inset: 0; border-radius: 12px; }
  .agcfd .agcfd-crumb-chip { font-size: 14px; }
  .agcfd .agcfd-recent-card { max-width: 100%; flex: 1 1 100%; }
  .agcfd .agcfd-brand { width: calc(33.333% - 7px); min-height: 80px; }
  .agcfd-types, .agcfd-famgrid, .agcfd-groups, .agcfd-diagrams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agcfd-panel { padding: 12px; }
  .agcfd-drawer { padding: 10px; }
  .agcfd-models { flex-basis: 100%; }
  .agcfd-modellist { max-height: none; }
}
