.directory-toolbar {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid #e5e5ea;
}
.directory-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; min-width: 0; }
.directory-title h1 {
  min-width: 0;
  margin: 0;
  color: #19191f;
  font-size: clamp(20px, 4.7vw, 27px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.028em;
  overflow-wrap: anywhere;
}
.directory-title > span { color: #73737d; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.directory-filters { flex: 0 0 auto; }
.directory-filters > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #dadce3;
  border-radius: 9px;
  background: #fff;
  color: #272730;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(22 24 31 / .06);
  transition: border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}
.directory-filters > summary::-webkit-details-marker { display: none; }
.directory-filters > summary::marker { content: ""; }
.directory-filters > summary .icon { width: 15px; height: 15px; }
.directory-filters > summary b {
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 3px;
  border-radius: 3px;
  background: #bd001d;
  color: #fff;
  font-size: 10px;
}
.directory-filters > summary:hover { border-color: #c7c9d1; background: #fafafa; }
.directory-filters[open] > summary { border-color: #c10020; background: #fff6f7; color: #b6001c; box-shadow: 0 0 0 3px rgb(193 0 32 / .08); }
.directory-filter-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(100%, 430px);
  max-height: min(70dvh, 540px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dedfe5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgb(24 24 34 / .15);
  color: #272730;
}
.directory-filters:not([open]) > .directory-filter-panel { display: none; }
.directory-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 42px;
  padding: 5px 12px;
  border-bottom: 1px solid #ececf0;
  font-size: 14px;
}
.directory-filter-panel-head > button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c6c76;
  font-size: 23px;
  cursor: pointer;
}
.directory-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.directory-filter-fields fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.directory-filter-fields legend { margin-bottom: 8px; padding: 0; font-size: 12px; font-weight: 750; }
.directory-filter-search {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid #dfe0e6;
  border-radius: 4px;
}
.directory-filter-search .icon { flex-shrink: 0; width: 13px; height: 13px; color: #71717c; }
.directory-filter-search input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #25252c;
  font: 16px/1.4 Inter, 'Noto Sans Devanagari', sans-serif;
}
.directory-filter-options { max-height: min(36dvh, 240px); margin-top: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.directory-filter-options > label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-height: 34px;
  padding: 7px 2px;
  color: #383842;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}
.directory-filter-options input { flex: 0 0 15px; width: 15px; height: 15px; margin: 2px 0 0; accent-color: #bd001f; }
.directory-filter-options span { min-width: 0; overflow-wrap: anywhere; }
.directory-filter-options [hidden] { display: none; }
.directory-filter-options p { color: #71717b; font-size: 11px; line-height: 1.5; }
.directory-filter-panel-actions { display: flex; flex-shrink: 0; gap: 10px; padding: 10px 12px; border-top: 1px solid #ececf0; }
.directory-filter-panel-actions button { min-height: 36px; padding: 7px 14px; border: 1px solid #dfe0e6; border-radius: 4px; background: #fff; color: #484851; font: 700 12px/1.4 Inter, 'Noto Sans Devanagari', sans-serif; cursor: pointer; }
.directory-filter-panel-actions button[type="submit"] { flex: 1; border-color: #bf001e; background: #bf001e; color: #fff; }
.directory-filter-fields:has(.directory-filter-topper-search) { grid-template-columns: minmax(0, 1fr); }
.directory-filter-topper-search { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
.directory-filter-topper-search input { width: 100%; height: 36px; padding: 5px 8px; border: 1px solid #dfe0e6; border-radius: 4px; color: #272730; background: #fff; font-family: inherit; font-size: 16px; }
.directory-filters :is(summary, input, button):focus-visible { outline: 2px solid #bb001f; outline-offset: 2px; }
.directory-filter-panel-head > span { display: grid; gap: 2px; }
.directory-filter-panel-head > span small { color: #777781; font-size: 10px; font-weight: 500; line-height: 1.4; }
body.directory-filter-modal-open { overflow: hidden; }
.directory-filters--popup[open] { z-index: 110; }
.directory-filter-modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: block;
  background: rgb(18 20 26 / .55);
  backdrop-filter: blur(5px);
  animation: directory-backdrop-in .18s ease-out;
}
.directory-filters--popup:not([open]) > .directory-filter-modal-backdrop { display: none; }
.directory-filters--popup > .directory-filter-panel {
  position: fixed;
  z-index: 101;
  top: 50%;
  right: auto;
  left: 50%;
  width: min(430px, calc(100vw - 32px));
  max-height: min(78dvh, 520px);
  border: 1px solid rgb(255 255 255 / .8);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgb(10 14 22 / .3);
  transform: translate(-50%,-50%);
  animation: directory-modal-in .2s ease-out;
}
.directory-filters--popup .directory-filter-panel-head { min-height: 76px; padding: 14px 18px; background: linear-gradient(145deg,#fff,#fafbfc); }
.directory-filters--popup .directory-filter-panel-head strong { color: #19191f; font-size: 19px; }
.directory-filters--popup .directory-filter-panel-head > button { border-radius: 8px; background: #f1f2f4; }
.directory-filters--popup .directory-filter-fields { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 20px 18px 18px; overflow: visible; }
.directory-filters--popup .directory-filter-panel-actions { padding: 13px 18px 16px; }
.directory-filters--popup .directory-filter-panel-actions button { min-height: 42px; border-radius: 7px; font-size: 13px; }
.directory-filter-select { display: grid; gap: 7px; color: #282830; font-size: 12px; font-weight: 750; }
.directory-filter-select select { width: 100%; min-height: 46px; padding: 9px 38px 9px 12px; border: 1px solid #d9dbe2; border-radius: 9px; background: #fff; color: #202027; font: 600 14px/1.4 Inter,'Noto Sans Devanagari',sans-serif; cursor: pointer; }
.directory-filter-select select:focus { border-color: #bd001f; box-shadow: 0 0 0 3px rgb(189 0 31/.1); outline: 0; }
@keyframes directory-backdrop-in { from { opacity: 0; } }
@keyframes directory-modal-in { from { opacity: 0; transform: translate(-50%,-50%) scale(.955); } }
.directory-pagination { grid-column: 1 / -1; }
.site-shell .news-archive { display: block; padding-top: 8px; }
.news-archive-list { margin-top: 0; }
.catalog-list-page .catalog-products { padding-top: 0; }
.catalog-list-page .catalog-product-card,
.catalog-list-page .catalog-product-card :is(a, h2, small) { text-decoration: none; }
.catalog-list-page .catalog-discount-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 3px;
  background: #ef1b2d;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
@media (min-width: 701px) {
  .directory-toolbar { min-height: 48px; margin-bottom: 12px; }
  .directory-title > span { font-size: 12px; }
  .directory-filter-search input { font-size: 13px; }
  .directory-filter-topper-search input { font-size: 14px; }
  .site-shell .news-archive { padding-top: 16px; }
}
@media (max-width: 700px) {
  .directory-filters--popup > .directory-filter-panel {
    top: 50%;
    bottom: auto;
    width: min(400px,calc(100vw - 28px));
    max-height: min(82dvh,520px);
    border-radius: 16px;
    transform: translate(-50%,-50%);
    animation-name: directory-modal-in;
  }
  .directory-filters--popup .directory-filter-panel-head { min-height: 70px; padding: 12px 14px; }
  .directory-filters--popup .directory-filter-panel-head strong { font-size: 17px; }
  .directory-filters--popup .directory-filter-fields { grid-template-columns: minmax(0,1fr); gap: 14px; padding: 17px 14px; }
  .directory-filters--popup .directory-filter-panel-actions { padding: 11px 14px 14px; }
  .site-shell .catalog-list-page { padding: 8px 12px 28px; }
  .catalog-list-page .catalog-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }
  .catalog-list-page .catalog-product-card {
    min-width: 0;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid #e7e8ed;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .catalog-list-page .catalog-product-link { display: grid; grid-template-columns: 98px minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; }
  .catalog-list-page .catalog-product-image { aspect-ratio: 4 / 3; border-radius: 5px; background: #fff; }
  .catalog-list-page--books .catalog-product-image { aspect-ratio: 4 / 5; }
  .catalog-list-page .catalog-product-image img { width: 100%; height: 100%; object-fit: contain; }
  .catalog-list-page .catalog-product-body { min-width: 0; padding: 0; }
  .catalog-list-page .catalog-product-body h2 { min-height: 0; margin: 5px 0; font-size: 14px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
  .catalog-list-page .catalog-product-body small { font-size: 10px; }
  .catalog-list-page .classplus-badges { flex-wrap: wrap; gap: 4px; }
  .catalog-list-page .classplus-badges b { padding: 3px 4px; font-size: 8px; }
  .catalog-list-page .catalog-discount-badge { padding: 3px 5px; font-size: 8px; }
  .catalog-list-page .catalog-product-card footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; margin: 8px 0 0 110px; padding: 0; }
  .catalog-list-page .catalog-price strong { font-size: 17px; line-height: 1.4; }
  .catalog-list-page .catalog-price del { font-size: 10px; }
  .catalog-list-page .catalog-product-card footer > a { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 32px; margin: 0; padding: 6px 9px; border-radius: 4px; font-size: 11px; }
  .latest-page > .latest-category-links { gap: 6px; margin-block: 8px; }
}

/* Compact shared pagination for news, books, courses and every filtered directory. */
.news-pagination.directory-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 14px auto 2px;
  padding: 4px;
  border: 1px solid #e3e5e9;
  border-radius: 10px;
  background: #f6f7f8;
  color: #62636c;
  font-size: 11px;
  box-shadow: 0 4px 14px rgb(24 28 36 / .05);
}
.news-pagination.directory-pagination > a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid #e1e3e7;
  border-radius: 7px;
  background: #fff;
  color: #a9001b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.news-pagination.directory-pagination > a:hover { border-color: #efb9c1; background: #fff7f8; }
.directory-page-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: #4d4e56;
  font-weight: 700;
  white-space: nowrap;
}

/* Professional image-led course and book cards. */
.catalog-list-page .catalog-card-grid { align-items: stretch; }
.catalog-list-page .catalog-product-card {
  border-color: #e3e6ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 22px rgb(24 31 42 / .07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.catalog-list-page .catalog-product-card:hover {
  border-color: #f2b5bd;
  box-shadow: 0 12px 30px rgb(24 31 42 / .11);
  transform: translateY(-2px);
}
.catalog-list-page .catalog-product-image {
  aspect-ratio: 4 / 3;
  padding: 6px;
  border-radius: 13px 13px 0 0;
  background: linear-gradient(145deg,#f7f8fa,#eef0f3);
}
.catalog-list-page .catalog-product-image img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: contain;
}
.catalog-list-page:not(.catalog-list-page--books) .catalog-product-image {
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.catalog-list-page:not(.catalog-list-page--books) .catalog-product-image img {
  border-radius: 10px;
  object-fit: contain;
}
.catalog-list-page .catalog-product-body { padding: 13px 14px 8px; }
.catalog-list-page .catalog-product-body h2 {
  min-height: 3em;
  margin: 9px 0 6px;
  color: #222730;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.5;
}
.catalog-list-page .catalog-product-card footer {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid #f0f1f3;
}
.catalog-list-page .catalog-price { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.catalog-list-page .catalog-price strong { color: #171a20; font-size: 20px; line-height: 1.2; }
.catalog-list-page .catalog-price del { color: #9397a0; font-size: 10px; }
.catalog-list-page .catalog-product-card footer > a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(145deg,#ef2035,#c60021);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 6px 14px rgb(198 0 33 / .16);
}

@media (max-width: 700px) {
  .site-shell .portal-main:has(.directory-pagination) { padding-bottom: 4px; }
  .site-shell .catalog-list-page,
  .roadmap-directory.portal-main { padding-bottom: 4px; }
  .catalog-list-page .catalog-card-grid { gap: 10px; }
  .catalog-list-page .catalog-product-card {
    display: grid;
    grid-template-columns: 116px minmax(0,1fr);
    grid-template-rows: minmax(0,1fr) auto;
    gap: 0 12px;
    margin: 0;
    padding: 10px;
    border: 1px solid #e4e6ea;
    border-radius: 13px;
    box-shadow: 0 5px 16px rgb(24 31 42 / .065);
    overflow: hidden;
  }
  .catalog-list-page .catalog-product-card:hover { transform: none; }
  .catalog-list-page .catalog-product-link { display: contents; }
  .catalog-list-page .catalog-product-image,
  .catalog-list-page--books .catalog-product-image {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 116px;
    height: 138px;
    aspect-ratio: auto;
    padding: 4px;
    border: 1px solid #eceef1;
    border-radius: 10px;
    background: linear-gradient(145deg,#f8f9fa,#eef0f3);
  }
  .catalog-list-page .catalog-product-image img { border-radius: 7px; object-fit: contain; }
  .catalog-list-page:not(.catalog-list-page--books) .catalog-product-image {
    grid-row: 1;
    width: 116px;
    height: auto;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .catalog-list-page .catalog-product-body { grid-column: 2; grid-row: 1; padding: 1px 0 7px; }
  .catalog-list-page .catalog-product-body h2 {
    display: -webkit-box;
    min-height: 0;
    margin: 6px 0 3px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .catalog-list-page .catalog-product-card footer {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px;
    align-self: end;
    margin: 0;
    padding: 8px 0 0;
    border-top: 1px solid #f0f1f3;
  }
  .catalog-list-page .catalog-price strong { font-size: 17px; }
  .catalog-list-page .catalog-product-card footer > a {
    min-height: 34px;
    max-width: 104px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 10.5px;
  }
  .news-pagination.directory-pagination { margin-top: 10px; margin-bottom: 0; }
  .news-pagination.directory-pagination > a { min-height: 32px; padding-inline: 9px; }
  .directory-page-status { min-height: 32px; padding-inline: 7px; font-size: 10px; }
}

@media (max-width: 370px) {
  .catalog-list-page .catalog-product-card { grid-template-columns: 104px minmax(0,1fr); gap: 0 10px; padding: 8px; }
  .catalog-list-page .catalog-product-image,
  .catalog-list-page--books .catalog-product-image { width: 104px; height: 130px; }
  .catalog-list-page:not(.catalog-list-page--books) .catalog-product-image { width: 104px; height: auto; aspect-ratio: 4 / 3; }
  .catalog-list-page .catalog-product-card footer > a { max-width: 92px; padding-inline: 7px; font-size: 9.5px; }
  .news-pagination.directory-pagination > a span { display: none; }
}
