.units-catalog {
  display: grid;

  overflow: scroll;
  overflow-x: hidden;

  grid-template-columns: repeat(auto-fill, minmax(calc((1vw + 1vh) * 4.3), 1fr));
  grid-auto-rows: calc((1vw + 1vh) * 4.3);
  justify-content: flex-start;
  justify-items: center;
  align-items: center;

  gap: max(24px, calc(24vh/12));

  flex: 1;

  padding: min(12px, calc(12 * 0.1667vh));
  border-radius: min(20px, calc(20 * 0.1667vh));
  background-color: rgba(60, 60, 60, 0.3);
}

.unit-button {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  width: calc((1vw + 1vh) * 4.5);
  height: calc((1vw + 1vh) * 4.5);

  min-width: calc((1vw + 1vh) * 4.5);

  aspect-ratio: 1 / 1;
  padding: 0;

  position: relative;
  overflow: hidden;

  border-radius: clamp(12px, 2.5vw, 18px);
  background: none;
  border: none;
  box-shadow: clamp(3px, 0.8vw, 5px) clamp(3px, 0.8vw, 5px) clamp(6px, 1.5vw, 10px) rgba(0, 0, 0, 0.5);

  cursor: pointer;

  transition: 0.15s;
}

@media (orientation: portrait) {
  .units-catalog {
    grid-template-columns: repeat(auto-fill, minmax(calc((1vw + 1vh) * 6), 1fr));
    grid-auto-rows: calc((1vw + 1vh) * 6);
  }

  .unit-button {
    width: calc((1vw + 1vh) * 6);
    height: calc((1vw + 1vh) * 6);

    min-width: calc((1vw + 1vh) * 6);
  }
}

@media (max-width: 1280px) and (orientation: landscape) {
  .units-catalog {
    grid-template-columns: repeat(auto-fill, minmax(calc((1vw + 1vh) * 7), 1fr));
    grid-auto-rows: calc((1vw + 1vh) * 7);
  }

  .unit-button {
    width: calc((1vw + 1vh) * 7);
    height: calc((1vw + 1vh) * 7);

    min-width: calc((1vw + 1vh) * 7);
  }
}

.unit-button:hover {
  filter: brightness(0.85);
  transform: scale(1.05);
}

.unit-button:hover .unit-picture {
  transform: scale(1.1);
}

.unit-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  flex-direction: column;
  padding: max(4px, calc(4vh/12));
  border-radius: max(16px, calc(16vh/12));
  z-index: 1;

  pointer-events: none;

  animation: spinUnitGradient 8s linear infinite;
}

.unit-gradient-texture {
  position: absolute;
  top: clamp(3px, 0.8vw, 5px);
  left: clamp(3px, 0.8vw, 5px);

  width: 90%;
  height: 90%;

  opacity: 0.3;
  filter: brightness(0.5);
  z-index: 2;
}

.unit-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  flex: 1;
  max-height: 100%;
  overflow: hidden;
  z-index: 3;
  position: relative;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: max(16px, calc(16vh/12));
  padding: clamp(2px, 0.6vw, 4px);
}

.unit-picture {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  align-self: center;
  justify-self: center;
  border-radius: max(16px, calc(16vh/12));
  z-index: 4;

  transition: 0.15s;
}

.unit-element {
  position: absolute;
  top: max(4px, calc(4vh/12));
  left: max(4px, calc(4vh/12));
  width: max(24px, calc(24vh/12)) !important;
  z-index: 5;
}

.unit-name {
  position: absolute;

  bottom: 0;
  width: 100%;
  padding: clamp(1px, 0.3vw, 2px) 0;

  background-color: rgba(0, 0, 0, 0.6);
  text-align: center;
  font-size: max(16px, calc(16vh/12)) !important;
  font-weight: 500;

  border-radius: 0 0 clamp(10px, 2vw, 16px) clamp(10px, 2vw, 16px);
  z-index: 5;
}