/**
 * Site Builder – template gallery (category tabs + preview grid)
 */

.builder-gallery {
  background: linear-gradient(180deg, #f8f9fc 0%, #fff 48%);
  padding: 56px 0 70px;
}

.builder-gallery__header {
  margin-bottom: 36px;
}

.builder-gallery__tabs {
  margin-bottom: 32px;
}

.builder-gallery .hosting-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid #e8edf6;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(28, 35, 52, 0.05);
}

.builder-gallery .hosting-tabs__nav > li {
  float: none;
  margin: 0;
}

.builder-gallery .hosting-tabs__nav > li > a {
  padding: 11px 22px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #1c2334 !important;
  background: #fff !important;
  border: 1.5px solid #e2e6ee !important;
  border-radius: 10px !important;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.builder-gallery .hosting-tabs__nav > li > a:hover {
  background: #f8f9fc !important;
  border-color: #ea1010 !important;
  color: #ea1010 !important;
}

.builder-gallery .hosting-tabs__nav > li.active > a,
.builder-gallery .hosting-tabs__nav > li.active > a:focus,
.builder-gallery .hosting-tabs__nav > li.active > a:hover {
  background: #ea1010 !important;
  color: #fff !important;
  border-color: #ea1010 !important;
  box-shadow: 0 4px 14px rgba(234, 16, 16, 0.25);
}

.builder-gallery__content {
  margin-top: 0 !important;
}

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

.builder-gallery__card {
  background: #fff;
  border: 1px solid #edf0f5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(28, 35, 52, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.builder-gallery__card:hover {
  transform: translateY(-4px);
  border-color: rgba(234, 16, 16, 0.28);
  box-shadow: 0 14px 36px rgba(28, 35, 52, 0.1);
}

.builder-gallery__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.builder-gallery__link:focus-visible {
  outline: 2px solid #ea1010;
  outline-offset: 2px;
}

.builder-gallery__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eef1f7;
}

.builder-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.builder-gallery__card:hover .builder-gallery__thumb img {
  transform: scale(1.05);
}

.builder-gallery__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 35, 52, 0.52);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.builder-gallery__card:hover .builder-gallery__overlay {
  opacity: 1;
}

.builder-gallery__overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #ea1010;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(234, 16, 16, 0.35);
}

.builder-gallery__overlay-btn::before {
  content: '\f06e';
  font-family: 'Font Awesome 5 Pro';
  font-weight: 400;
  font-size: 14px;
}

.builder-gallery__title {
  margin: 0;
  padding: 14px 16px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #1c2334;
  text-align: center;
}

@media screen and (max-width: 991px) {
  .builder-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media screen and (max-width: 767px) {
  .builder-gallery {
    padding: 48px 0 56px;
  }

  .builder-gallery .hosting-tabs__nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .builder-gallery .hosting-tabs__nav > li {
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .builder-gallery__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
