/* Галерея камней — адаптив */
.stone-gallery {
  --sg-gap: 24px;
  --sg-stone-size: 90px;
  --sg-radius: 16px;
  --sg-shadow: 0 8px 24px rgba(0,0,0,.12);
  color: #1a1a1a;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

.stone-gallery *,
.stone-gallery *::before,
.stone-gallery *::after {
  box-sizing: border-box;
}

.sg-title {
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0 0 40px;
  line-height: 1.25;
}

.sg-stones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 18px 12px;
  justify-items: center;
  margin-bottom: 32px;
}

.sg-stone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 110px;
}

.sg-stone:hover {
  transform: translateY(-3px);
}

.sg-stone:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
  border-radius: 8px;
}

.sg-stone-circle {
  width: var(--sg-stone-size);
  height: var(--sg-stone-size);
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sg-stone.active .sg-stone-circle {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25), 0 6px 16px rgba(0,0,0,.2);
  transform: scale(1.06);
}

.sg-stone-label {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.25;
  color: #333;
  max-width: 100%;
  word-break: break-word;
}

.sg-stone.active .sg-stone-label {
  color: #2563eb;
  font-weight: 600;
}

.sg-note {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: -12px 0 28px;
  font-style: italic;
}

.sg-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sg-gap);
  min-height: 280px;
}

.sg-photo {
  border-radius: var(--sg-radius);
  overflow: hidden;
  box-shadow: var(--sg-shadow);
  background: #f0f0f0;
  aspect-ratio: 3 / 4;
  position: relative;
}

.sg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease, transform 0.4s ease;
}

.sg-photo:hover img {
  transform: scale(1.03);
}

.sg-photos.is-loading .sg-photo img {
  opacity: 0.4;
}

.sg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 16px;
}

@media (max-width: 900px) {
  .sg-photos {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stone-gallery {
    --sg-stone-size: 72px;
    --sg-gap: 14px;
    padding: 16px 12px 32px;
  }

  .sg-stones {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 14px 8px;
  }

  .sg-stone-label {
    font-size: 11px;
  }

  .sg-photos {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sg-photo {
    aspect-ratio: 4 / 5;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 400px) {
  .stone-gallery {
    --sg-stone-size: 64px;
  }

  .sg-stones {
    grid-template-columns: repeat(3, 1fr);
  }
}
