.theme-library-page .page-hero p {
  max-width: 780px;
}

.theme-library-section {
  padding-top: 0;
}

.theme-library-filters {
  margin-bottom: 28px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--color-border, #e7ebf0);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(19, 39, 65, 0.08);
}

.theme-library-filters__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)) auto;
  gap: 16px;
  align-items: end;
}

.theme-library-field {
  display: grid;
  gap: 8px;
}

.theme-library-field__label {
  color: var(--color-primary, #1a3558);
  font-size: 0.92rem;
  font-weight: 600;
}

.theme-library-field input,
.theme-library-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--color-border, #dbe4ee);
  border-radius: 14px;
  background: #fff;
  color: var(--color-primary, #1a3558);
}

.theme-library-field input:focus,
.theme-library-field select:focus {
  outline: none;
  border-color: var(--color-primary, #1a3558);
  box-shadow: 0 0 0 3px rgba(26, 53, 88, 0.08);
}

.theme-library-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-library-actions .btn {
  min-height: 48px;
  justify-content: center;
  white-space: nowrap;
}

.theme-library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.theme-library-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: #fff;
  border: 1px solid var(--color-border, #e7ebf0);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(19, 39, 65, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-library-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(19, 39, 65, 0.12);
}

.theme-library-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #f4f7fb;
  overflow: hidden;
}

.theme-library-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-library-card__body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.theme-library-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-library-card__cats {
  margin: 0;
  color: var(--color-text-secondary, #607089);
  font-size: 0.9rem;
  line-height: 1.6;
}

.theme-library-card__downloads {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--color-primary, #1a3558);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.theme-library-card__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--color-primary, #1a3558);
}

.theme-library-card__title a {
  color: inherit;
  text-decoration: none;
}

.theme-library-card__price {
  color: var(--color-primary, #1a3558);
  font-weight: 700;
}

.theme-library-card__price .amount {
  font-size: 1.1rem;
}

.theme-library-card__button {
  width: 100%;
  justify-content: center;
}

.theme-library-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.theme-library-empty {
  padding: 40px 32px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--color-border, #e7ebf0);
  border-radius: 24px;
}

.theme-library-empty h2 {
  margin: 0 0 12px;
  color: var(--color-primary, #1a3558);
}

.theme-library-empty p {
  margin: 0;
  color: var(--color-text-secondary, #607089);
}

.theme-library-pagination {
  margin-top: 32px;
}

.theme-library-pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-library-pagination .page-numbers a,
.theme-library-pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e7ebf0);
  background: #fff;
  color: var(--color-primary, #1a3558);
  text-decoration: none;
}

.theme-library-pagination .page-numbers .current {
  background: var(--color-primary, #1a3558);
  border-color: var(--color-primary, #1a3558);
  color: #fff;
}

@media (max-width: 1199px) {
  .theme-library-filters__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 767px) {
  .theme-library-filters {
    padding: 18px;
  }

  .theme-library-filters__grid {
    grid-template-columns: 1fr;
  }

  .theme-library-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-library-actions .btn {
    width: 100%;
  }

  .theme-library-grid {
    grid-template-columns: 1fr;
  }

  .theme-library-card__body {
    padding: 18px;
  }

  .theme-library-card__meta {
    flex-direction: column;
    align-items: stretch;
  }
}
