.template6-market-page {
  background: #f3f4f7;
}

.template6-market-page__section {
  padding: 168px 0 96px;
}

.template6-market-page__shell {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.template6-market-page__header {
  max-width: 860px;
  margin: 0 auto 34px;
  text-align: center;
}

.template6-market-page__header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 500;
  line-height: 1.04;
  text-transform: uppercase;
  color: #1d4f93;
}

.template6-market-page__header p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #5d6c80;
}

.template6-market-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px 26px;
  align-items: stretch;
  justify-content: center;
}

.template6-market-card {
  display: block;
  grid-column: span 2;
  position: relative;
  min-height: 148px;
  width: 100%;
  max-width: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: #1f4f93;
  box-shadow: 0 10px 18px rgba(69, 98, 133, 0.16), 0 2px 4px rgba(69, 98, 133, 0.08);
  text-decoration: none;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.template6-market-grid > .template6-market-card:last-child:nth-child(3n + 1) {
  grid-column: 3 / span 2;
}

.template6-market-grid > .template6-market-card:nth-last-child(2):nth-child(3n + 1) {
  grid-column: 2 / span 2;
}

.template6-market-grid > .template6-market-card:last-child:nth-child(3n + 2) {
  grid-column: 4 / span 2;
}

.template6-market-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template6-market-card--image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 45, 85, 0.16) 0%, rgba(13, 45, 85, 0.48) 100%);
}

.template6-market-card__overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.template6-market-card__overlay h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.22;
  text-transform: uppercase;
  color: #fff;
}

.template6-market-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(69, 98, 133, 0.2), 0 4px 10px rgba(69, 98, 133, 0.08);
}

.template6-market-empty {
  padding: 42px 32px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(69, 98, 133, 0.08);
  text-align: center;
  color: #5d6c80;
}

@media (max-width: 991.98px) {
  .template6-market-page__section {
    padding: 138px 0 72px;
  }

  .template6-market-page__shell {
    width: min(100% - 32px, 1240px);
  }

  .template6-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template6-market-card {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .template6-market-page__section {
    padding: 122px 0 54px;
  }

  .template6-market-page__shell {
    width: calc(100% - 24px);
  }

  .template6-market-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .template6-market-card {
    min-height: 136px;
  }
}
