.templates-carousel {
  position: relative;
  overflow: hidden;
}

.templates-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 4px 2px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.templates-track::-webkit-scrollbar {
  display: none;
}

.template-slide {
  flex: 0 0 calc((100% - 36px) / 3);
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.templates-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
}

.templates-counter {
  color: #8c857d;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.templates-arrow-group {
  display: flex;
  gap: 10px;
}

.templates-arrow {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3b7a7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #3a3733;
  cursor: pointer;
  font: inherit;
  font-size: 19px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.templates-arrow:hover {
  border-color: #b15533;
  background: #fff;
  transform: translateY(-1px);
}

.templates-arrow:focus-visible,
.templates-track:focus-visible {
  outline: 3px solid #6f8d96;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .template-slide {
    flex-basis: calc((100% - 18px) / 2);
  }
}

@media (max-width: 640px) {
  .templates-track {
    gap: 14px;
  }

  .template-slide {
    flex-basis: 100%;
  }

  .templates-controls {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .templates-track {
    scroll-behavior: auto;
  }

  .templates-arrow {
    transition: none;
  }
}
