.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-gallery-main {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 13px);
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--transition-slow), border-color var(--transition-slow);

  img,
  video,
  object {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
  }
}

.product-gallery-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  min-height: 30px;
  border: 1px solid rgba(30, 60, 56, 0.25);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border-radius: var(--radius-full, 999px);
  padding: 0 10px;
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.toolbar-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.document-viewer {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px;
  text-align: center;

  p {
    margin: 0;
    color: var(--text-primary);
    font-weight: var(--font-weight-bold, 700);
  }

  a {
    min-height: 38px;
    border-radius: var(--radius-full, 999px);
    border: 1px solid #497671;
    color: #2e5e59;
    text-decoration: none;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    font-weight: var(--font-weight-bold, 700);
  }
}

.product-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.product-gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-primary);
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);

  &.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(73, 118, 113, 0.18);
  }

  &:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
  }

  &:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.product-gallery-video {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 60, 56, 0.48);
  color: #fff;
  z-index: 1;
}

.product-gallery-doc {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  background: rgba(30, 60, 56, 0.78);
  color: #fff;
  border-radius: var(--radius-full, 999px);
  padding: 2px 8px;
  font-size: var(--font-size-xs, 0.75rem);
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .product-gallery-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
  }
}
