:root {
  --pcat-brand-dark: #283470;
  --pcat-brand-mid: #3f88c7;

  --pcat-ink: #131826;
  --pcat-ink-mid: #3a424d;
  --pcat-ink-soft: #686e7d;
  --pcat-ink-muted: #9da4ae;

  --pcat-border: #e5e7eb;
  --pcat-surface: #f9fafb;
  --pcat-surface-alt: #f3f4f6;

  --pcat-accent: #C3110C;
  --pcat-accent-bg: #FDECEC;

  --pcat-card-bg: #dbe1f6;
  --pcat-white: #fff;

  --pcat-radius-sm: 4px;
  --pcat-radius: 8px;
  --pcat-radius-lg: 16px;
  --pcat-radius-pill: 99px;

  --pcat-transition: 0.2s ease;

  --pcat-brand-gradient: linear-gradient(269.61deg,
      var(--pcat-brand-mid) 0.33%,
      var(--pcat-brand-dark) 99.67%);
}

/* ── Page wrapper ─────────────────────────────────────────── */
.pcat-page {
  background: var(--pcat-white);
}

/* ── Hero ─────────────────────────────────────────────────── */
.pcat-hero {
  position: relative;
  min-height: 350px;
  padding: 108px 24px 80px;
  background:
    linear-gradient(135deg, rgba(19, 24, 38, .45), rgba(19, 24, 38, .45)),
    var(--pcat-hero-bg, url('/banners/BannerKH.png')) center / cover no-repeat;
  text-align: center;
}

.pcat-breadcrumb-wrap {
  position: absolute;
  top: 14px;
  inset-inline: 0;
  z-index: 2;
}

.pcat-breadcrumb {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  background: transparent;
}

.pcat-breadcrumb .breadcrumb-item,
.pcat-breadcrumb .breadcrumb-sep {
  color: var(--pcat-white);
  font-size: 14px;
  line-height: 21px;
  text-decoration: none;
}

.pcat-breadcrumb .breadcrumb-item.is-active {
  font-weight: 600;
}

.pcat-breadcrumb .breadcrumb-item::before {
  display: none;
}

.pcat-hero-title {
  margin: 0 0 24px;
  color: var(--pcat-white);
  font-size: 45px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, .3);
}

/* ── Search bar ───────────────────────────────────────────── */
.pcat-search-wrap {
  max-width: 650px;
  margin: 0 auto;
}

.pcat-search {
  display: flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  background: rgba(255, 255, 255, .97);
  border-radius: var(--pcat-radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.pcat-search__icon {
  flex: none;
  padding-left: 17px;
  color: var(--pcat-brand-dark);
  font-size: 20px;
}

.pcat-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--pcat-ink-mid);
  font-size: 14px;
  background: transparent;
}

.pcat-search__input::placeholder {
  color: var(--pcat-ink-muted);
  font-style: italic;
}

.pcat-search__btn {
  align-self: stretch;
  min-width: 90px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--pcat-radius-pill);
  color: var(--pcat-white);
  font-size: 14px;
  font-weight: 600;
  background: var(--pcat-brand-gradient);
  cursor: pointer;
  transition: opacity var(--pcat-transition);
}

.pcat-search__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ── List section ─────────────────────────────────────────── */
.pcat-list {
  padding: 32px 0;
}

.pcat-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.pcat-list__title {
  margin: 0;
  color: var(--pcat-brand-dark);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
}

/* ── Card grid ────────────────────────────────────────────── */
.pcat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.pcat-card {
  overflow: hidden;
  background: var(--pcat-white);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: box-shadow var(--pcat-transition), transform var(--pcat-transition);
}

.pcat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(19, 24, 38, .1);
}

.pcat-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.7 / 1;
  background: var(--pcat-card-bg);
}

.pcat-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pcat-card__body {
  padding: 16px;
}

.pcat-card__title {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 6px;
  color: var(--pcat-ink);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pcat-card__desc {
  display: -webkit-box;
  overflow: hidden;
  color: #3A424D ;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.pcat-card.title-two-lines .pcat-card__desc {
    -webkit-line-clamp: 2;
}

.pcat-pagination:empty {
    margin-top: 0;
}

/* ── Skeleton loader ──────────────────────────────────────── */
@keyframes pcatShimmer {
  0% {
    background-position: -600px 0;
  }

  100% {
    background-position: 600px 0;
  }
}

.pcat-skeleton {
  overflow: hidden;
  background: var(--pcat-white);
  border-radius: var(--pcat-radius);
  pointer-events: none;
}

.pcat-skeleton__media {
  aspect-ratio: 1.6 / 1;
  background: #e8eaf0;
}

.pcat-skeleton__body {
  padding: 14px 16px 18px;
}

.pcat-skeleton__line {
  border-radius: 4px;
  background: linear-gradient(90deg, #e8eaf0 25%, #f4f5f9 50%, #e8eaf0 75%);
  background-size: 600px 100%;
  animation: pcatShimmer 1.4s ease-in-out infinite;
}

.pcat-skeleton__line--title {
  width: 80%;
  height: 14px;
  margin-bottom: 8px;
}

.pcat-skeleton__line--title2 {
  width: 55%;
  height: 14px;
  margin-bottom: 14px;
}

.pcat-skeleton__line--desc {
  width: 100%;
  height: 12px;
  margin-bottom: 6px;
}

.pcat-skeleton__line--desc2 {
  width: 90%;
  height: 12px;
  margin-bottom: 6px;
}

.pcat-skeleton__line--desc3 {
  width: 60%;
  height: 12px;
}

/* ── State messages ───────────────────────────────────────── */
.pcat-state-msg {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
}

.pcat-state-msg.is-error {
  color: #dc2626;
}

.pcat-state-msg.is-empty {
  color: #6b7280;
}

/* ── Pagination ───────────────────────────────────────────── */
.pcat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.pcat-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: var(--pcat-radius-sm);
  color: var(--pcat-ink-muted);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  transition: all var(--pcat-transition);
}

.pcat-page-link.is-active {
  background: var(--pcat-brand-dark);
  color: var(--pcat-white);
}

.pcat-page-link.is-bordered {
  border-color: #4E5663;
  color: #4E5663;
}

.pcat-page-link.is-disabled {
  opacity: .35;
  pointer-events: none;
}

.pcat-page-link i {
  font-size: 10px;
}

.pcat-page-link:hover:not(.is-active):not(.is-disabled) {
  background: var(--pcat-surface-alt);
  color: var(--pcat-brand-dark);
}

/* ── Modal overlay ────────────────────────────────────────── */
.pcat-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 16px 24px 24px;
  background: rgba(19, 24, 38, .7);
  backdrop-filter: blur(4px);
}

.pcat-modal.is-open {
  display: flex;
}

.pcat-modal__panel {
  display: flex;
  flex-direction: column;
  width: 90%;
  height: 100%;
  max-height: 94vh;
  overflow: hidden;
  background: var(--pcat-white);
  border-radius: var(--pcat-radius-lg);
  box-shadow: -10px 0 50px rgba(0, 0, 0, .2);
  animation: pcatModalSlideIn .3s ease-out;
}

@keyframes pcatModalSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.pcat-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--pcat-border);
}

.pcat-modal__header-title {
  margin: 0;
  color: var(--pcat-brand-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.pcat-modal__close-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--pcat-brand-dark);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--pcat-transition);
}

.pcat-modal__close-btn:hover {
  color: var(--pcat-ink);
}

.pcat-modal__body {
  display: grid;
  grid-template-rows: auto 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.pcat-modal__item-title {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--pcat-surface-alt);
  color: var(--pcat-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
}

.pcat-modal__columns {
  display: grid;
  grid-template-columns: 386px 1fr;
  min-height: 0;
}

.pcat-modal__left {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--pcat-border);
}

.pcat-modal__thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 1.6 / 1;
  object-fit: cover;
  object-position: center;
  background: var(--pcat-card-bg);
  border-radius: var(--pcat-radius);
}

.pcat-modal__info-box {
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--pcat-border);
  border-radius: var(--pcat-radius);
}

.pcat-modal__section-title {
  padding: 12px 16px;
  border-bottom: 1px solid var(--pcat-border);
  background: var(--pcat-surface);
  color: var(--pcat-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.pcat-modal__meta-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 18px 16px;
}

.pcat-modal__meta-row {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 16px;
  align-items: flex-start;
  color: var(--pcat-ink);
  font-size: 12px;
  line-height: 18px;
}

.pcat-modal__meta-label {
  color: var(--pcat-ink-soft);
  font-weight: 500;
}

.pcat-modal__meta-value {
  min-width: 0;
  text-align: justify;
  text-align-last: right;
  word-break: break-word;
  font-weight: 700;
}

.pcat-modal__meta-value.mota-value {
  text-align: justify;
  text-align-last: right;
}

.pcat-modal__right {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.pcat-modal__desc-box {
  display: flex;
  flex-direction: column;
  max-height: 550px;
  overflow: hidden;
  border: 1px solid var(--pcat-border);
  border-radius: var(--pcat-radius);
}

.pcat-modal__desc-text {
  flex: 1;
  overflow-y: auto;
  padding: 26px 16px;
  color: var(--pcat-ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
}

.pcat-modal__desc-text p {
  margin: 0 0 12px;
}

.pcat-modal__desc-text p:last-child {
  margin-bottom: 0;
}

.pcat-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--pcat-border);
}

.pcat-modal__close-footer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border: 1px solid var(--pcat-accent);
  border-radius: 6px;
  background: var(--pcat-white);
  color: var(--pcat-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--pcat-transition);
}

.pcat-modal__close-footer:hover {
  background: var(--pcat-accent-bg);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199px) {
  .pcat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .pcat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
  }

  .pcat-hero {
    min-height: 280px;
    padding: 90px 20px 60px;
  }

  .pcat-hero-title {
    font-size: 34px;
  }

  .pcat-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .pcat-modal__panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--pcat-radius-lg) var(--pcat-radius-lg) 0 0;
  }

  .pcat-modal__columns {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .pcat-list__title {
    font-size: 20px;
  }

  .pcat-list {
    padding: 16px 0;
  }

  .pcat-list__header {
    margin-bottom: 16px;
  }

  .pcat-modal__left {
    border-right: none;
    border-bottom: 1px solid var(--pcat-border);
    padding-bottom: 16px;
  }

  .pcat-modal__thumbnail {
    max-height: 200px;
    object-fit: cover;
  }
}

@media (max-width: 767px) {
  .pcat-hero {
    min-height: 240px;
    padding: 80px 16px 48px;
  }

  .pcat-hero-title {
    font-size: 26px;
    margin-bottom: 18px;
  }

  .pcat-search-wrap {
    max-width: 100%;
  }

  .pcat-search__btn {
    min-width: 76px;
    padding: 0 16px;
    font-size: 13px;
  }

  .pcat-list {
    padding: 20px 16px;
  }

  .pcat-list__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .pcat-list__title {
    font-size: 18px;
  }

  .pcat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .pcat-card__title {
    font-size: 14px;
    line-height: 20px;
  }

  .pcat-card__desc {
    font-size: 12px;
    line-height: 18px;
    min-height: 36px;
  }

  .pcat-pagination {
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .pcat-modal__meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pcat-modal__meta-value {
    text-align: left;
    text-align-last: left;
  }
}

@media (max-width: 479px) {
  .pcat-hero {
    min-height: 200px;
    padding: 70px 14px 40px;
  }

  .pcat-page {
    margin-top: 60px !important;
  }

  .pcat-hero-title {
    font-size: 22px;
  }

  .pcat-card {
    display: grid;
    grid-template-columns: 4fr 8fr;
  }

  .pcat-card__media {
    width: 100%;
    height: 74px;
    aspect-ratio: auto;
  }

  .pcat-card__media img {
    height: 100%;
  }

  .pcat-card__body {
    padding: 10px 12px;
  }

  .pcat-card__title {
    font-size: 13px;
    line-height: 18px;
    -webkit-line-clamp: 2;
    margin-bottom: 4px;
  }

  .pcat-card__desc {
    font-size: 12px;
    line-height: 16px;
    -webkit-line-clamp: 2;
    min-height: 0;
  }

  .pcat-breadcrumb .breadcrumb-item,
  .pcat-breadcrumb .breadcrumb-sep {
    font-size: 12px;
  }

  .pcat-search {
    height: 38px;
  }

  .pcat-search__icon {
    padding-left: 14px;
    font-size: 17px;
  }

  .pcat-search__input {
    font-size: 13px;
  }

  .pcat-search__btn {
    min-width: 68px;
    padding: 0 12px;
    font-size: 12px;
  }

  .pcat-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pcat-pagination {
    gap: 6px;
  }

  .pcat-page-link {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .pcat-modal__panel {
    max-height: 95vh;
  }

  .pcat-list__title {
    font-size: 16px;
  }

  .pcat-list {
    padding: 16px;
  }

  .pcat-list__header {
    margin-bottom: 16px;
  }

  .pcat-modal__header-title {
    font-size: 13px;
  }

  .pcat-modal__item-title {
    font-size: 15px;
    line-height: 22px;
    padding: 12px 14px 8px;
  }

  .pcat-modal__columns {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .pcat-modal__left,
  .pcat-modal__right {
    padding: 12px;
    overflow-y: visible;
    border: none;
  }

  .pcat-modal__section-title {
    font-size: 13px;
    padding: 10px 14px;
  }

  .pcat-modal__desc-box {
    max-height: none;
  }

  .pcat-modal__desc-text {
    padding: 16px 14px;
    font-size: 13px;
  }

  .pcat-modal__footer {
    padding: 12px 14px;
  }

  .pcat-modal__close-footer {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
  }
}
