* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #ffffff;
  color: #071b3a;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.page-header {
  min-height: 204px;
  padding: 2.125rem 0 0;
  background: #eff9ff;
}

.breadcrumb {
  display: none;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1.8rem;
  color: #415675;
  font-size: 0.68rem;
}

.breadcrumb a {
  color: #1473c9;
  text-decoration: none;
}

.category-hero {
  position: relative;
  display: grid;
  width: min(100%, 800px);
  min-height: 160px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  margin: 0 auto;
  padding: 0 8px;
}

.hero-copy h1 {
  margin-bottom: 0.5rem;
  color: #071b3a;
  font-size: 1.85rem;
  line-height: 1.15;
}

.brand-dots {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.blue { background: #071b3a; }
.dot.red { background: #e52d38; }
.dot.lightblue { background: #62b9e8; }
.dot.green { background: #329648; }

.hero-copy p {
  max-width: 430px;
  margin-top: 2.3rem;
  color: #263b59;
  font-size: 0.68rem;
  line-height: 1.35;
}

.hero-icon {
  position: absolute;
  top: -2.95rem;
  right: 2.7rem;
  width: 190px;
  height: 190px;
  object-fit: contain;
}

.back-link {
  position: absolute;
  right: 3.1rem;
  bottom: 0;
  color: #1687ca;
  font-size: 0.72rem;
  text-decoration: none;
}

.catalog-main {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 1.1rem 8px 1.5rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 78px;
  align-items: center;
  gap: 0.65rem;
}

.search-field,
.department-field {
  position: relative;
  display: flex;
  height: 30px;
  align-items: center;
  border: 1px solid #071b3a;
  border-radius: 18px;
}

.search-field {
  gap: 0.5rem;
  padding: 0 0.7rem;
}

.search-field svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: #071b3a;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #071b3a;
  font: inherit;
  font-size: 0.62rem;
}

.search-field input::placeholder {
  color: #526782;
  opacity: 1;
}

.department-field {
  padding: 0 0.55rem;
}

.department-field span {
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  padding: 0 0.2rem;
  background: #ffffff;
  color: #526782;
  font-size: 0.58rem;
}

.department-field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #526782;
  font: inherit;
  font-size: 0.65rem;
}

.search-button {
  height: 30px;
  border: 0;
  border-radius: 18px;
  background: #68b7e8;
  color: #071b3a;
  cursor: pointer;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
}

.search-button:hover {
  background: #52a9df;
}

.results-toolbar {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  margin: 2.2rem 0;
  color: #526782;
  font-size: 0.62rem;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 26px;
  padding: 0 0.4rem;
  border: 1px solid #071b3a;
  border-radius: 15px;
}

.page-size select {
  border: 0;
  outline: 0;
  background: transparent;
  color: #071b3a;
  font: inherit;
}

.results-count {
  margin: 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

.service-card {
  display: flex;
  min-width: 0;
  min-height: 162px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.6rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.provider-logo {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: center;
}

.provider-logo img {
  display: block;
  max-width: 90%;
  max-height: 72px;
  object-fit: contain;
  transition: opacity 180ms ease;
}

.provider-logo-fallback {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: #eaf6fc;
  color: #1473c9;
  font-size: 1.25rem;
  font-weight: 700;
}

.pay-link {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(158px, calc(100% - 1rem));
  min-height: 42px;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0.96);
  border-radius: 999px;
  background: #071b3a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.service-card:hover,
.service-card:focus-within {
  border-color: #62b9e8;
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1);
}

.service-card:hover .provider-logo img,
.service-card:focus-within .provider-logo img {
  opacity: 0.28;
}

.service-card:hover .provider-logo-fallback,
.service-card:focus-within .provider-logo-fallback {
  opacity: 0.28;
}

.service-card:hover .pay-link,
.service-card:focus-within .pay-link {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.pay-link:focus-visible {
  outline: 3px solid #62b9e8;
  outline-offset: 3px;
}

.service-card:hover .service-name,
.service-card:focus-within .service-name {
  color: #a7b3c4;
}

.service-name {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  color: #071b3a;
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-results {
  grid-column: 1 / -1;
  padding: 2rem 1rem;
  color: #526782;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.5rem auto 0;
}

.page-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #071b3a;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
}

.page-button.arrow {
  background: #071b3a;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
}

.page-button[aria-current="page"] {
  background: #071b3a;
  color: #ffffff;
  font-weight: 700;
}

.page-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.page-button.arrow:disabled {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 620px) {
  .page-header {
    min-height: 190px;
  }

  .category-hero {
    min-height: 140px;
  }

  .hero-copy h1 {
    font-size: 1.55rem;
  }

  .hero-copy p {
    max-width: 220px;
    margin-top: 1.5rem;
  }

  .hero-icon {
    top: -1.5rem;
    right: 0;
    width: 110px;
    height: 110px;
  }

  .back-link {
    right: 0;
  }

  .catalog-main {
    padding: 1rem 0.85rem 1.5rem;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 0.65rem 0.45rem;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .department-field {
    width: 100%;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .service-card {
    min-height: 145px;
  }
}

@media (hover: none) {
  .provider-logo img {
    opacity: 0.45;
  }

  .provider-logo-fallback {
    opacity: 0.45;
  }

  .pay-link {
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
  }
}
