.gtranslate-buttons {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%;
}
.gtranslate-buttons:has(.gtranslate-btn:only-child),
.gtranslate-buttons:has(.gtranslate-btn:nth-child(2):last-child),
.gtranslate-buttons:has(.gtranslate-btn:nth-child(3):last-child),
.gtranslate-buttons:has(.gtranslate-btn:nth-child(4):last-child) {
  justify-content: center;
}

.gtranslate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1.5px solid #e2e5f3;
  border-radius: 12px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #283645;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  line-height: 1.2;
  min-height: 40px;
  flex: 0 1 auto;
  max-width: 100%;
}

.gtranslate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.gtranslate-btn:hover::before {
  left: 100%;
}

.gtranslate-btn:hover {
  background: linear-gradient(135deg, #f0f9ff 0%, #e8f4f8 100%);
  border-color: #5ac3f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 195, 240, 0.2);
  color: #001698;
}

.gtranslate-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(90, 195, 240, 0.15);
}

.gtranslate-btn img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gtranslate-btn:hover img {
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.gtranslate-btn span {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.2px;
  transition: color 0.3s ease;
}

.gtranslate-btn.active {
  background: linear-gradient(135deg, #009dac 0%, #008a9a 100%);
  color: #ffffff;
  border-color: #009dac;
  box-shadow: 0 4px 12px rgba(0, 157, 172, 0.3);
  position: relative;
}

.gtranslate-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  border-radius: 12px;
  pointer-events: none;
}

.gtranslate-btn.active:hover {
  background: linear-gradient(135deg, #008a9a 0%, #007a88 100%);
  border-color: #008a9a;
  box-shadow: 0 6px 16px rgba(0, 157, 172, 0.4);
  color: #ffffff;
}

.gtranslate-btn.active img {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.gtranslate-btn.active span {
  color: #ffffff;
  font-weight: 700;
}

@media (max-width: 768px) {
  .gtranslate-buttons {
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .gtranslate-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 36px;
    border-radius: 10px;
    flex: 0 1 auto;
  }

  .gtranslate-btn img {
    width: 18px;
    height: 18px;
  }

  .gtranslate-buttons:has(.gtranslate-btn:nth-child(n + 6)) .gtranslate-btn {
    padding: 0.4375rem 0.625rem;
    font-size: 0.75rem;
    min-height: 32px;
  }
}

@media (max-width: 480px) {
  .gtranslate-buttons {
    gap: 0.375rem;
    justify-content: flex-start;
  }

  .gtranslate-btn {
    padding: 0.4375rem 0.625rem;
    font-size: 0.75rem;
    min-height: 32px;
    gap: 0.375rem;
    flex: 0 1 auto;
  }

  .gtranslate-btn img {
    width: 16px;
    height: 16px;
  }

  .gtranslate-buttons:has(.gtranslate-btn:nth-child(n + 5)) .gtranslate-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    min-height: 30px;
    gap: 0.25rem;
  }

  .gtranslate-buttons:has(.gtranslate-btn:nth-child(n + 5))
    .gtranslate-btn
    img {
    width: 14px;
    height: 14px;
  }
}

.gtranslate-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(90, 195, 240, 0.3);
}

.gtranslate-btn.active:focus {
  box-shadow: 0 0 0 3px rgba(0, 157, 172, 0.4),
    0 4px 12px rgba(0, 157, 172, 0.3);
}
